Skip to content

Commit

Permalink
Allow to use fixture and fixture.page as tag literals (closes DevExpr…
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyBelym committed Jul 30, 2019
1 parent cef05a4 commit 8dea661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/server/data/test-suites/typescript-basic/testfile1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ test(test2Name, async() => {
return 'F1T2';
});

fixture(`Fixture${1 + 1}`)
.page('http://example.org')
fixture`Fixture${1 + 1}`
.page`http://${'example'}.org`
.beforeEach(async () => 'yo')
.afterEach(async () => 'yo');

Expand Down
8 changes: 5 additions & 3 deletions ts-defs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ interface TestCafe {
* Creates the test runner that is used to configure and launch test tasks.
*/
createRunner(): Runner;

/**
* Creates the live mode test runner that is used to configure and launch test tasks.
*/
Expand Down Expand Up @@ -1861,15 +1861,17 @@ interface FixtureFn {
* Declares a test fixture.
*
* @param name - The name of the fixture.
* @param tagArgs - tag literal arguments required to support the "fixture`${x}`" syntax
*/
(name: string | TemplateStringsArray): this;
(name: string | TemplateStringsArray, ...tagArgs: any[]): this;
/**
* Specifies a webpage at which all tests in a fixture start.
*
* @param url - The URL of the webpage where tests start.
* @param tagArgs - tag literal arguments required to support the "fixture.page`${x}`" syntax
* To test webpages in local directories, you can use the `file://` scheme or relative paths.
*/
page(url: string | TemplateStringsArray): this;
page(url: string | TemplateStringsArray, ...tagArgs: any[]): this;
/**
* Specifies HTTP Basic or Windows (NTLM) authentication credentials for all tests in the fixture.
*
Expand Down

0 comments on commit 8dea661

Please sign in to comment.