Skip to content

Commit d9ef5ee

Browse files
DavertMikclaude
andcommitted
test: stop hitting codecept.io live site for flake-prone selectors
The .frameworks/.mountains/[alt="React"] and .logo selectors no longer exist on the new codecept.io homepage, so two specs went red: - Playwright_test.js: 'should wait for invisible combined with dontseeElement' - WebDriver_test.js: 'should check text is not equal to empty string of element text' Point both at the local /info fixture using elements that already exist there (#grab-multiple, a[id="first-link"], #grab-css, #p-no-text). Same assertions, no external network dependency. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a7b80b2 commit d9ef5ee

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

test/helper/Playwright_test.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,14 @@ describe('Playwright', function () {
200200
await I.waitToHide('h9')
201201
})
202202

203-
it('should wait for invisible combined with dontseeElement', async function () {
204-
this.timeout(30000) // Increase timeout for external URL test
205-
await I.amOnPage('https://codecept.io/')
206-
await I.waitForVisible('.frameworks', 10)
207-
await I.waitForVisible('[alt="React"]', 10)
208-
await I.waitForVisible('.mountains', 10)
209-
await I._withinBegin('.mountains', async () => {
210-
await I.dontSeeElement('[alt="React"]')
211-
await I.waitForInvisible('[alt="React"]', 2)
203+
it('should wait for invisible combined with dontseeElement', async () => {
204+
await I.amOnPage('/info')
205+
await I.waitForVisible('#grab-multiple', 10)
206+
await I.waitForVisible('a[id="first-link"]', 10)
207+
await I.waitForVisible('#grab-css', 10)
208+
await I._withinBegin('#grab-css', async () => {
209+
await I.dontSeeElement('a[id="first-link"]')
210+
await I.waitForInvisible('a[id="first-link"]', 2)
212211
})
213212
})
214213
})

test/helper/WebDriver_test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,14 @@ describe('WebDriver', function () {
424424
})
425425

426426
it('should check text is not equal to empty string of element text', async () => {
427-
await wd.amOnPage('https://codecept.io')
427+
await wd.amOnPage('/info')
428428

429429
try {
430-
await wd.seeTextEquals('', '.logo')
431-
await wd.seeTextEquals('This is not empty', '.logo')
430+
await wd.seeTextEquals('', '#p-no-text')
431+
await wd.seeTextEquals('This is not empty', '#p-no-text')
432432
} catch (e) {
433433
expect(e).to.be.instanceOf(Error)
434-
expect(e.message).to.equal('expected element .logo "This is not empty" to equal ""')
434+
expect(e.message).to.equal('expected element #p-no-text "This is not empty" to equal ""')
435435
}
436436
})
437437
})

0 commit comments

Comments
 (0)