Skip to content

Commit

Permalink
Simplify Carousel Header block e2e test
Browse files Browse the repository at this point in the history
It was considered slow before
  • Loading branch information
mleray committed Jan 17, 2025
1 parent 99f8836 commit 26843e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions tests/e2e/blocks/carousel-header.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ const slides = [
* @param {{Page, Editor}} options - Page and Editor object
*/
const addSlide = async (slide, {index, addNext}, {page, editor}) => {
const title = page.getByRole('textbox', {name: 'Enter title'}).nth(index);
await title.click();
await title.fill(`My test Header ${index + 1}`);
await page.getByRole('textbox', {name: 'Enter title'}).nth(index)
.fill(`My test Header ${index + 1}`);

const description = page.getByRole('textbox', {name: 'Enter description'}).nth(index);
await description.click();
await description.fill(`Testing carousel description ${index + 1}`);
await page.getByRole('textbox', {name: 'Enter description'}).nth(index)
.fill(`Testing carousel description ${index + 1}`);

const ctaBtn = page.getByRole('textbox', {name: 'Enter CTA text'}).nth(index);
await ctaBtn.click();
await ctaBtn.fill(`Read more ${index + 1}`);
await page.getByRole('textbox', {name: 'Enter CTA text'}).nth(index)
.fill(`Read more ${index + 1}`);

// Check if sidebar is not visible
await editor.openDocumentSettingsSidebar();
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tools/lib/covers.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function checkCoversBlock(page) {
}

// Check Load more button
const loadMoreBtn = await page.$('button.load-more-btn');
const loadMoreBtn = await page.locator('button.load-more-btn');
if (loadMoreBtn) {
await expect(page.locator('button.load-more-btn')).toHaveText('Read more');
}
Expand Down

0 comments on commit 26843e3

Please sign in to comment.