Skip to content

Commit

Permalink
update tests to work both on cloud and on 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Niek Raaijmakers committed Jun 28, 2021
1 parent b2a6ec3 commit 5b4956f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/archetype/ui.tests/test-module/lib/wdio.commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,16 @@ browser.addCommand('AEMSitesSetPageTitle', function(parentPath, name, title) {

// Navigate to page parent path
browser.url(path.posix.join(AEM_SITES_PATH, parentPath));
#if ( $aemVersion != "cloud" )
const checkboxSelector = `[data-foundation-collection-item-id="${path.posix.join(parentPath, name)}"] td:first-child img`;
#else
const checkboxSelector = `[data-foundation-collection-item-id="${path.posix.join(parentPath, name)}"] [type="checkbox"]`;
#end

// Select sample page in the list
$(`[data-foundation-collection-item-id="${path.posix.join(parentPath, name)}"] [type="checkbox"]`).waitForClickable();
$(checkboxSelector).waitForClickable();
browser.pause(1000); // Avoid action bar not appearing after clicking checkbox
$(`[data-foundation-collection-item-id="${path.posix.join(parentPath, name)}"] [type="checkbox"]`).click();
$(checkboxSelector).click();
// Access page properties form
$('[data-foundation-collection-action*="properties"]').click();
// Store original title
Expand All @@ -128,7 +134,7 @@ browser.addCommand('AEMSitesSetPageTitle', function(parentPath, name, title) {
// Submit
$('[type="submit"]').click();
// Wait until we get redirected to the Sites console
$(`[data-foundation-collection-item-id="${path.posix.join(parentPath, name)}"] [type="checkbox"]`).waitForExist();
$(checkboxSelector).waitForExist();

return originalTitle;
});
Expand Down
4 changes: 4 additions & 0 deletions src/main/archetype/ui.tests/test-module/specs/aem/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ describe('AEM Basic', () => {

$('[data-foundation-toggleable-control-src$="solutionswitcher.html"]').click();

#if ( $aemVersion != "cloud" )
$('coral-shell-solutionswitcher').waitForDisplayed();
#else
$('coral-shell-menu[aria-label$="solutions"]').waitForDisplayed();
#end
});

});

0 comments on commit 5b4956f

Please sign in to comment.