|
1 |
| -import { test } from '@playwright/test'; |
| 1 | +import { test, expect } from '@playwright/test'; |
2 | 2 | import { BaseMethods } from '../../../playwright-e2e/common/base';
|
3 | 3 | import { baseSelectors } from '../../../playwright-e2e/common/selectors';
|
4 | 4 | import { Constants } from '../../../playwright-e2e/fixtures/constants';
|
@@ -50,14 +50,17 @@ test.describe('Vue 2 in Vue 3', () => {
|
50 | 50 | });
|
51 | 51 | });
|
52 | 52 |
|
53 |
| - test(`Check that in ${property.headerName} app by default counter set to 0`, async ({ page }) => { |
| 53 | + test(`Check that in ${property.headerName} app counter is rendered`, async ({ page }) => { |
54 | 54 | const basePage = new BaseMethods(page);
|
55 | 55 | await basePage.openLocalhost({ number: property.host });
|
56 |
| - await basePage.checkElementWithTextPresence({ |
57 |
| - selector: baseSelectors.tags.coreElements.div, |
58 |
| - text: Constants.commonPhrases.vue2InVue3App.defaultCounterText, |
59 |
| - visibilityState: 'be.visible', |
60 |
| - }); |
| 56 | + const counter = page |
| 57 | + .locator(baseSelectors.tags.coreElements.div) |
| 58 | + .filter({ hasText: 'count:' }) |
| 59 | + .first(); |
| 60 | + await expect(counter).toBeVisible(); |
| 61 | + const text = (await counter.innerText()).trim(); |
| 62 | + const match = text.match(/count:\s*(\d+)/); |
| 63 | + expect(match).not.toBeNull(); |
61 | 64 | });
|
62 | 65 |
|
63 | 66 | test(`Checks component state visibility for ${property.headerName}`, async ({ page }) => {
|
|
0 commit comments