From ce8d64a72ccad5ce729880fcfef78df610712b93 Mon Sep 17 00:00:00 2001 From: Aleksey Popov Date: Fri, 24 Dec 2021 13:08:04 +0300 Subject: [PATCH] test: added test [Regression](GH-3495) - Visibility check should incorporate visibility of parent SVG element(s) --- .../regression/gh-3495/pages/index.html | 14 +++++++++++++ .../fixtures/regression/gh-3495/test.js | 10 +++++++++ .../gh-3495/testcafe-fixtures/index.js | 21 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 test/functional/fixtures/regression/gh-3495/pages/index.html create mode 100644 test/functional/fixtures/regression/gh-3495/test.js create mode 100644 test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.js diff --git a/test/functional/fixtures/regression/gh-3495/pages/index.html b/test/functional/fixtures/regression/gh-3495/pages/index.html new file mode 100644 index 00000000000..6fa615ae10d --- /dev/null +++ b/test/functional/fixtures/regression/gh-3495/pages/index.html @@ -0,0 +1,14 @@ + + +
+ + + +
+ + diff --git a/test/functional/fixtures/regression/gh-3495/test.js b/test/functional/fixtures/regression/gh-3495/test.js new file mode 100644 index 00000000000..3aa74ed51c5 --- /dev/null +++ b/test/functional/fixtures/regression/gh-3495/test.js @@ -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'); + }); +}); + + diff --git a/test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.js b/test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.js new file mode 100644 index 00000000000..cf103ed91aa --- /dev/null +++ b/test/functional/fixtures/regression/gh-3495/testcafe-fixtures/index.js @@ -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(); +});