Skip to content

Conversation

@OleksandrYuzhnyi
Copy link
Collaborator

  • Added tests for url check;
  • Added test for navigation check.

Known issues:

  • Navigation header doesn't work with Safari (investigation in progress);
  • Not all screenshots are displayed on screener.io dashboard.

@nadvolod
Copy link
Contributor

@OleksandrYuzhnyi I made a number of updates to some files. It's not in a resolved state and I'm not sure if this fixes the issue. However, I was able to get to a state that connects a lot of the dots. When I ran the suite of tests only on the combination that I specified, I got a bunch of errors from the tests. Looks like locator related for a lot of them. That makes sense because the test wasn't able to finish, hence, there was never a visual snapshot. Here are the errors that I'm getting from different tests. You could probably pull down this branch and try it yourself.


------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-4] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-4] Session ID: d87d3133e18a4338bcdb9ea8b05b3c7c
[chrome 97.0.4692.71 windows #0-4]
[chrome 97.0.4692.71 windows #0-4] » /test/specs/urlCheck/hongKongRegion.spec.js
[chrome 97.0.4692.71 windows #0-4] Hong Kong region url check
[chrome 97.0.4692.71 windows #0-4]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-4]
[chrome 97.0.4692.71 windows #0-4] 1 failing (26.8s)
[chrome 97.0.4692.71 windows #0-4]
[chrome 97.0.4692.71 windows #0-4] 1) Hong Kong region url check HomePage check
[chrome 97.0.4692.71 windows #0-4] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-4] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-4]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-4]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-4]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-4]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-4]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/hongKongRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-8] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-8] Session ID: 2e6ecad039ab44a1bfbe0fe5eda1bd1b
[chrome 97.0.4692.71 windows #0-8]
[chrome 97.0.4692.71 windows #0-8] » /test/specs/urlCheck/unitedKingdomRegion.spec.js
[chrome 97.0.4692.71 windows #0-8] United Kingdom region url check
[chrome 97.0.4692.71 windows #0-8]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-8]
[chrome 97.0.4692.71 windows #0-8] 1 failing (25.3s)
[chrome 97.0.4692.71 windows #0-8]
[chrome 97.0.4692.71 windows #0-8] 1) United Kingdom region url check HomePage check
[chrome 97.0.4692.71 windows #0-8] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-8] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-8]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-8]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-8]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-8]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-8]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/unitedKingdomRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-6] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-6] Session ID: 58a4fb8a4fa04a7291dfdd88ffb26a2d
[chrome 97.0.4692.71 windows #0-6]
[chrome 97.0.4692.71 windows #0-6] » /test/specs/urlCheck/koreaRegion.spec.js
[chrome 97.0.4692.71 windows #0-6] Korea region url check
[chrome 97.0.4692.71 windows #0-6]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-6]
[chrome 97.0.4692.71 windows #0-6] 1 failing (26.7s)
[chrome 97.0.4692.71 windows #0-6]
[chrome 97.0.4692.71 windows #0-6] 1) Korea region url check HomePage check
[chrome 97.0.4692.71 windows #0-6] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-6] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-6]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-6]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-6]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-6]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-6]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/koreaRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-1] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-1] Session ID: 2e20b522e842461faca5855c1d3eb886
[chrome 97.0.4692.71 windows #0-1]
[chrome 97.0.4692.71 windows #0-1] » /test/specs/urlCheck/deutschlandRegion.spec.js
[chrome 97.0.4692.71 windows #0-1] Deutschland region url check
[chrome 97.0.4692.71 windows #0-1]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-1]
[chrome 97.0.4692.71 windows #0-1] 1 failing (24.8s)
[chrome 97.0.4692.71 windows #0-1]
[chrome 97.0.4692.71 windows #0-1] 1) Deutschland region url check HomePage check
[chrome 97.0.4692.71 windows #0-1] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-1] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-1]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-1]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-1]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-1]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-1]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/deutschlandRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-5] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-5] Session ID: be8dfd26d6fd496a820b42286d0b29ae
[chrome 97.0.4692.71 windows #0-5]
[chrome 97.0.4692.71 windows #0-5] » /test/specs/urlCheck/japanRegion.spec.js
[chrome 97.0.4692.71 windows #0-5] Japan region url check
[chrome 97.0.4692.71 windows #0-5]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-5]
[chrome 97.0.4692.71 windows #0-5] 1 failing (27s)
[chrome 97.0.4692.71 windows #0-5]
[chrome 97.0.4692.71 windows #0-5] 1) Japan region url check HomePage check
[chrome 97.0.4692.71 windows #0-5] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-5] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-5]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-5]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-5]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-5]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-5]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/japanRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-2] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-2] Session ID: 8732428eb05f4d97bdc8c7b51f8e21a8
[chrome 97.0.4692.71 windows #0-2]
[chrome 97.0.4692.71 windows #0-2] » /test/specs/urlCheck/europeRegion.spec.js
[chrome 97.0.4692.71 windows #0-2] Europe region url check
[chrome 97.0.4692.71 windows #0-2]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-2]
[chrome 97.0.4692.71 windows #0-2] 1 failing (38.9s)
[chrome 97.0.4692.71 windows #0-2]
[chrome 97.0.4692.71 windows #0-2] 1) Europe region url check HomePage check
[chrome 97.0.4692.71 windows #0-2] Can't call scrollIntoView on element with selector "//a[@class="minicart-link"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-2] Error: Can't call scrollIntoView on element with selector "//a[@class="minicart-link"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-2]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-2]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-2]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-2]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:19:9)
[chrome 97.0.4692.71 windows #0-2]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/europeRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-3] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-3] Session ID: e57ff6c1a5954801b7bdc6007b35bd29
[chrome 97.0.4692.71 windows #0-3]
[chrome 97.0.4692.71 windows #0-3] » /test/specs/urlCheck/franceRegion.spec.js
[chrome 97.0.4692.71 windows #0-3] France region url check
[chrome 97.0.4692.71 windows #0-3]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-3]
[chrome 97.0.4692.71 windows #0-3] 1 failing (24.2s)
[chrome 97.0.4692.71 windows #0-3]
[chrome 97.0.4692.71 windows #0-3] 1) France region url check HomePage check
[chrome 97.0.4692.71 windows #0-3] Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-3] Error: Can't call scrollIntoView on element with selector "//a[text()="Terms of Use"]" because element wasn't found
[chrome 97.0.4692.71 windows #0-3]     at Object.implicitWait [as default] (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/utils/implicitWait.js:34:19)
[chrome 97.0.4692.71 windows #0-3]     at async Element.elementErrorHandlerCallbackFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/webdriverio/build/middlewares.js:20:29)
[chrome 97.0.4692.71 windows #0-3]     at async Element.wrapCommandFn (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/node_modules/@wdio/utils/build/shim.js:106:29)
[chrome 97.0.4692.71 windows #0-3]     at async HomePage.makeScreenShot (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/pageObject/page.js:17:9)
[chrome 97.0.4692.71 windows #0-3]     at async Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/franceRegion.spec.js:12:9)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-7] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-7] Session ID: a27fd4dfb44e4e4c8f02b7d0ca261caf
[chrome 97.0.4692.71 windows #0-7]
[chrome 97.0.4692.71 windows #0-7] » /test/specs/urlCheck/newZelandRegion.spec.js
[chrome 97.0.4692.71 windows #0-7] New Zeland region url check
[chrome 97.0.4692.71 windows #0-7]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-7]
[chrome 97.0.4692.71 windows #0-7] 1 failing (1m 34s)
[chrome 97.0.4692.71 windows #0-7]
[chrome 97.0.4692.71 windows #0-7] 1) New Zeland region url check HomePage check
[chrome 97.0.4692.71 windows #0-7] Cannot read property 'ok' of undefined
[chrome 97.0.4692.71 windows #0-7] TypeError: Cannot read property 'ok' of undefined
[chrome 97.0.4692.71 windows #0-7]     at Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/newZelandRegion.spec.js:14:16)
[chrome 97.0.4692.71 windows #0-7]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
------------------------------------------------------------------
[chrome 97.0.4692.71 windows #0-0] Running: chrome (v97.0.4692.71) on windows
[chrome 97.0.4692.71 windows #0-0] Session ID: a34eb12495db44b08ac045052fdd1a67
[chrome 97.0.4692.71 windows #0-0]
[chrome 97.0.4692.71 windows #0-0] » /test/specs/urlCheck/australiaRegion.spec.js
[chrome 97.0.4692.71 windows #0-0] Australia region url check
[chrome 97.0.4692.71 windows #0-0]    ✖ HomePage check
[chrome 97.0.4692.71 windows #0-0]
[chrome 97.0.4692.71 windows #0-0] 1 failing (1m 32.1s)
[chrome 97.0.4692.71 windows #0-0]
[chrome 97.0.4692.71 windows #0-0] 1) Australia region url check HomePage check
[chrome 97.0.4692.71 windows #0-0] Cannot read property 'ok' of undefined
[chrome 97.0.4692.71 windows #0-0] TypeError: Cannot read property 'ok' of undefined
[chrome 97.0.4692.71 windows #0-0]     at Context.<anonymous> (/Users/nikolay/source/js/automation-best-practices/testing-for-charity/my-react-app/test/specs/urlCheck/australiaRegion.spec.js:14:12)
[chrome 97.0.4692.71 windows #0-0]     at processTicksAndRejections (internal/process/task_queues.js:95:5)

@nadvolod
Copy link
Contributor

@OleksandrYuzhnyi after some investigation, i found a number of issues. Please see my updated code. I'll send you a video of my feedback. We need to:

  1. Make the code work correctly first and foremost. The visual layout in Screener is very important here.
  2. Then think about optimizations.
    This line will scroll all the way to the bottom of a page, I think hehe

@OleksandrYuzhnyi
Copy link
Collaborator Author

@nadvolod thank you for the review. I found it extremely helpful. Please check my last changes to the code.
I was able to get 3 screenshots for 5 regions
image
image
Unfortunately tests for some regions (korea, japan) are not stable and I am currently working on them.

@OleksandrYuzhnyi
Copy link
Collaborator Author

@nadvolod I have updated and made code little bit cleaner than it was. Please try it on your environment.

@nadvolod
Copy link
Contributor

@OleksandrYuzhnyi everything worked. I moved over the code into a separate folder for the customer. Feel free to try on your end to make sure it works.
https://github.com/saucelabs-training/automation-best-practices/tree/main/visual-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants