-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip request hooks initialization for skiped tests (#8260)
<!-- Thank you for your contribution. Before making a PR, please read our contributing guidelines at https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution We recommend creating a *draft* PR, so that you can mark it as 'ready for review' when you are done. --> ## Purpose Request hooks are initialized even though the test is skipped ## Approach check if test is skipped before initialization ## References closes #8229 ## Pre-Merge TODO - [ ] Write tests for your proposed changes - [ ] Make sure that existing tests do not fail --------- Co-authored-by: Bayheck <[email protected]>
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test/functional/fixtures/api/es-next/request-hooks/testcafe-fixtures/api/8229.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { RequestMock, Selector } from 'testcafe'; | ||
|
||
const PAGE_URL = 'http://localhost:3000/fixtures/api/es-next/request-hooks/pages/api/empty.html'; | ||
|
||
fixture('Fixture') | ||
.page(PAGE_URL); | ||
|
||
test('before the skipped', async t => { | ||
await t.expect(Selector('h1').exists).ok(); | ||
}); | ||
|
||
test.skip.requestHooks( | ||
RequestMock().onRequestTo(/.*empty*/).respond('', 404) | ||
)('skipped', async t => { | ||
await t.expect(Selector('h1').exists).ok(); | ||
}); | ||
|
||
test('after the skipped', async t => { | ||
await t.expect(Selector('h1').exists).ok(); | ||
}); |