forked from DevExpress/testcafe-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
247dd1c
commit d1b8196
Showing
7 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[{package.json,.eslintrc,.babelrc,.travis.yml}] | ||
indent_size = 2 |
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,10 @@ | ||
* text=auto | ||
*.sh text eol=lf | ||
*.js text eol=lf | ||
*.ts text eol=lf | ||
*.css text eol=lf | ||
*.html text eol=lf | ||
*.md text eol=lf | ||
|
||
*.png binary | ||
*.ico binary |
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,6 @@ | ||
/node_modules | ||
.idea | ||
.vscode | ||
yarn.lock | ||
package-lock.json | ||
.npmrc |
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,17 @@ | ||
{ | ||
"name": "testcafe-examples", | ||
"version": "0.0.1", | ||
"author": { | ||
"name": "Developer Express Inc.", | ||
"url": "https://www.devexpress.com/" | ||
}, | ||
"description": "This repository contains sample test files that help you learn how to use TestCafe.", | ||
"license": "MIT", | ||
"dependencies": { | ||
"lodash": "^4.17.15", | ||
"testcafe": "^1.5.0" | ||
}, | ||
"scripts": { | ||
"test": "testcafe chrome tests" | ||
} | ||
} |
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,10 @@ | ||
import { ClientFunction } from 'testcafe'; | ||
|
||
fixture `Fixture` | ||
.clientScripts({ module: 'lodash'}); | ||
|
||
test('Inject module as a custom client script', async t => { | ||
const result = await t.eval(() => _.defaults({ 'a': 1 }, { 'a': 3, 'b': 2 })); | ||
|
||
await t.expect(result).eql({ a: 1, b: 2 }); | ||
}); |
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,14 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture `Fixture` | ||
.page('https://devexpress.github.io/testcafe/example/'); | ||
|
||
test('How to inspect an element markup', async t => { | ||
const selector = Selector('label[for]').addCustomDOMProperties({ | ||
outerHTML: el => el.outerHTML | ||
}); | ||
|
||
const elementOuterHTML = await selector().outerHTML; | ||
|
||
await t.expect(elementOuterHTML).eql('<label for="remote-testing"><input type="checkbox" name="remote" id="remote-testing">Support for testing on remote devices</label>'); | ||
}); |
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,14 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture `Fixture` | ||
.page('https://devexpress.github.io/testcafe/example/'); | ||
|
||
test('How to reload the tested page', async t => { | ||
await t.typeText('#developer-name', 'Peter Parker'); | ||
|
||
await t.eval(() => location.reload(true)); | ||
|
||
await t | ||
.wait(3000) | ||
.expect(Selector('#developer-name').value).eql(''); | ||
}); |