forked from DevExpress/testcafe
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added test [Regression](DevExpressGH-3495) - Visibility check s…
…hould incorporate visibility of parent SVG element(s)
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
test/functional/fixtures/regression/gh-3495/pages/index.html
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 @@ | ||
<html> | ||
<body> | ||
<div> | ||
<span data-test="checkbox"> | ||
<div id="parent" style="display:none"> | ||
<svg id="child" fill="grey" stroke="red" viewBox="0 0 300 100"> | ||
<circle cx="50" cy="50" r="40"/> | ||
<circle cx="150" cy="50" r="4"/> | ||
</svg> | ||
</div> | ||
</span> | ||
</div> | ||
</body> | ||
</html> |
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 @@ | ||
describe('[Regression](GH-3495) - Visibility check should incorporate visibility of parent SVG element(s)', function () { | ||
it('Check visibility parent', function () { | ||
return runTests('testcafe-fixtures/index.js', 'Paren shouldn\'t be visible'); | ||
}); | ||
it('Check visibility child', function () { | ||
return runTests('testcafe-fixtures/index.js', 'Child shouldn\'t be visible'); | ||
}); | ||
}); | ||
|
||
|
21 changes: 21 additions & 0 deletions
21
test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.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,21 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture`Fixture` | ||
.page('../pages/index.html'); | ||
|
||
test('Paren shouldn\'t be visible', async t => { | ||
const svg = Selector('#parent'); | ||
|
||
await t | ||
.expect(svg.exists).ok() | ||
.debug() | ||
.expect(svg.visible).notOk(); | ||
}); | ||
|
||
test('Child shouldn\'t be visible', async t => { | ||
const svg = Selector('#child'); | ||
|
||
await t | ||
.expect(svg.exists).ok() | ||
.expect(svg.visible).notOk(); | ||
}); |