From ffc84fd724f87ad922e5796ce4c50d0c5489a544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Louvard?= <9567496+cnrun@users.noreply.github.com> Date: Tue, 3 Nov 2020 20:38:55 +0100 Subject: [PATCH] feat: Tests/enhance e2e test coverage (#326) * locate search field * use search field * open and close panel for risk description * add test for "hamburger menu" * run testcafe file with tests.ts extention. * Test should test local server. * add screenshots * rename .test.ts to spec.ts * format code * format code * take some screenshots * add some screenshots * fix typo * screenshots in ignore list * remove existence and visibility tests because of redundancy * tests should run localy * remove unused configuration entry * chore: refactor testcafe e2e tests, make some more code reusable (#349) Co-authored-by: ChristophWersal <45358216+ChristophWersal@users.noreply.github.com> --- .gitignore | 1 + .../{testUtils.ts => elements/muiButton.ts} | 5 -- testcafe/elements/muiTypography.ts | 10 ++++ testcafe/introScreens.spec.ts | 25 +-------- testcafe/pages/Intro.ts | 33 +++++++++++ testcafe/pages/MainMap.ts | 17 ++++++ testcafe/searchField.spec.ts | 55 +++++++++++++++++++ 7 files changed, 119 insertions(+), 27 deletions(-) rename testcafe/{testUtils.ts => elements/muiButton.ts} (58%) create mode 100644 testcafe/elements/muiTypography.ts create mode 100644 testcafe/pages/Intro.ts create mode 100644 testcafe/pages/MainMap.ts create mode 100644 testcafe/searchField.spec.ts diff --git a/.gitignore b/.gitignore index c38af412..96cf4526 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ CovQuestions/ static/changelog.md package-lock.json hosting/data +screenshots/ diff --git a/testcafe/testUtils.ts b/testcafe/elements/muiButton.ts similarity index 58% rename from testcafe/testUtils.ts rename to testcafe/elements/muiButton.ts index ecdd8bf9..9b3cb43e 100644 --- a/testcafe/testUtils.ts +++ b/testcafe/elements/muiButton.ts @@ -1,10 +1,5 @@ import { Selector } from "testcafe"; -// This should work with text inside a Material-UI -export function textExists(titleForIntro1: string) { - return Selector("p").withText(titleForIntro1).exists; -} - // This should work with the label of a Material-UI