mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
Improved count of items in e2e tests (#15986)
refs TryGhost/Team#2371 - We need to wait selectors before count them https://github.com/microsoft/playwright/issues/14278 These changes needed to make the results of tests more stable on the CI
This commit is contained in:
parent
8d2418578d
commit
7ef157b17f
@ -23,8 +23,10 @@ test.describe('Admin', () => {
|
||||
await page.locator('button span:has-text("Save")').click();
|
||||
await page.waitForSelector('button span:has-text("Saved")');
|
||||
await page.locator('.gh-nav a[href="#/members/"]').click();
|
||||
const count = await page.locator('tbody > tr').count();
|
||||
expect(count).toBe(1);
|
||||
|
||||
// check number of members
|
||||
await expect(page.locator('[data-test-list="members-list-item"]')).toHaveCount(1);
|
||||
|
||||
const member = page.locator('tbody > tr > a > div > div > h3').nth(0);
|
||||
await expect(member).toHaveText(name);
|
||||
const memberEmail = page.locator('tbody > tr > a > div > div > p').nth(0);
|
||||
@ -49,8 +51,10 @@ test.describe('Admin', () => {
|
||||
await page.locator('button span:has-text("Save")').click();
|
||||
await page.waitForSelector('button span:has-text("Saved")');
|
||||
await page.locator('.gh-nav a[href="#/members/"]').click();
|
||||
const count = await page.locator('tbody > tr').count();
|
||||
expect(count).toBe(1);
|
||||
|
||||
// check number of members
|
||||
await expect(page.locator('[data-test-list="members-list-item"]')).toHaveCount(1);
|
||||
|
||||
const member = page.locator('tbody > tr > a > div > div > h3').nth(0);
|
||||
await expect(member).toHaveText(name);
|
||||
const memberEmail = page.locator('tbody > tr > a > div > div > p').nth(0);
|
||||
|
Loading…
Reference in New Issue
Block a user