hpi-schul-cloud / end-to-end-tests

Apache License 2.0
9 stars 0 forks source link

"elem not interactable" when using data-attributes #6

Closed MxmRz closed 5 years ago

MxmRz commented 5 years ago

I changed the selectors in loginData.js so that they use the data-attributes from the schulcloud-client branch 785:

usernameInput: "input[data-testid='username']",
passwordInput: "input[data-testid='password']",
loginBtn: "input[data-testid='submit-login']"

When running a login-test locally (teacherLogin in this example), I can see the right mail-adress "demo-lehrer@schul-cloud.org" being put in the username-login-field. But then the tests fails with the following error:

1) Scenario: User inputs the username and password # features\teacherLogin.feature:16
   √ Before # runtime\world.js:258
   √ Given The user arrives on the Schul-Cloud homepage # step_definitions\teacherLogin-steps.js:8
   × When they put in demo-lehrer@schul-cloud.org and schulcloud and click the login-button # step_definitions\teacherLogin-steps.js:12
       element not interactable
       Error: An element command could not be completed because the element is not visible on the page.
           at elementIdValue("0.6530075324861824-2", "demo-lehrer@schul-cloud.org") - C:\Users\Job\Desktop\integration-tests\node_modules\webdriverio\build\lib\commands\setValue.js:46:80
   - Then they should see their dashboard # step_definitions\teacherLogin-steps.js:17
   - Then the dashboard should look like it looked before for demo-lehrer@schul-cloud.org # step_definitions\teacherLogin-steps.js:21
   √ After # runtime\world.js:330
       Attachment (image/png)
   √ After # runtime\world.js:309

1 scenario (1 failed)
4 steps (1 failed, 2 skipped, 1 passed)
0m05.008s
Cucumber HTML report C:\Users\Job\Desktop\integration-tests\reports\KlassiTech Automated Test Report-2019-03-08.html generated successfully.
janrenz commented 5 years ago

denke irdentische Problem, element existiert zwei Mal auf der Seite .... eins davon nicht eingeblendet ... Løssung.. Div drumherum mit eigenem Selen tor und dann die Selektoren verschachteln ..

janrenz commented 5 years ago

closed, because its not related to data attributes but do non specific selectors and items occurring multiple times on the page