Skip to content

Commit

Permalink
Try fixing style variation e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Mar 25, 2022
1 parent 7212027 commit b266ab1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/e2e-tests/specs/site-editor/style-variations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@ async function getAvailableStyleVariations() {
return page.$$( VARIATION_ITEMS_STYLES_SELECTOR );
}

async function applyVariation( number ) {
async function applyVariation( title ) {
await toggleGlobalStyles();
await openOtherStyles();
const variations = await getAvailableStyleVariations();
await variations[ number ].click();
const variation = await await page.waitForXPath(
`//*[@role="button"][@aria-label="${ title }"]`
);
await variation.focus();
await page.keyboard.press( 'Enter' );
}

async function applyPinkVariation() {
await applyVariation( 1 );
await applyVariation( 'pink' );
}

async function applyYellowVariation() {
await applyVariation( 2 );
await applyVariation( 'yellow' );
}

async function openColorsPanel() {
Expand Down

0 comments on commit b266ab1

Please sign in to comment.