FCTA_JS: 2.5.3 Github Action activity failed with error

Hi, so i followed the steps in foundation automation section 2.4.2 and ran the process. I noticed immediately that it was running with warnings about the node.js version. But then the process failed during the e2e checks with the following error:

[0-0] Error in "My Login application.should login with valid credentials"
Error: Can't call getText on element with selector ".card-title" because element wasn't found
    at async Context.<anonymous> (D:\a\MOT_cert\MOT_cert\test\specs\Login.e2e.js:13:8)
[0-0] 2024-08-28T13:38:41.258Z INFO webdriver: COMMAND deleteSession()
[0-0] 2024-08-28T13:38:41.258Z INFO webdriver: [DELETE] http://localhost:64922/session/b4c9d3358ae194f070c05ad93728a6a4
[0-0] 2024-08-28T13:38:41.552Z INFO webdriver: RESULT null
[0-0] 2024-08-28T13:38:41.553Z INFO webdriver: Kill driver process with PID 2652
[0-0] FAILED in chrome - file:///D:/a/MOT_cert/MOT_cert/test/specs/Login.e2e.js
2024-08-28T13:38:41.655Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2024-08-28T13:38:41.656Z INFO @wdio/cli:launcher: Run onComplete hook

Spec Files:	 1 passed, 1 failed, 2 total (100% completed) in 00:01:05  

2024-08-28T13:38:41.657Z INFO @wdio/local-runner: Shutting down spawned worker
2024-08-28T13:38:41.907Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2024-08-28T13:38:41.908Z INFO @wdio/local-runner: shutting down

Error: Process completed with exit code 1.

Since the previous activity i havent touched the code apart from adding the required folders and .yml script
Can i get some help fixing this?

1 Like

Probably need a little more information, like screenshots of trying to run the command.

Are these logs from CI or local?
What was the node warning?
Is the correct version of node installed (β€œwe install NodeJS 18”)?
Are there any other errors or warnings?

2 Likes

I’m guessing it just can’t find the element in the DOM?
Is it still there? :smiley:

(not sure what the goal is of this, as wadders said, we need a bit more info :smiley: )

1 Like

Hi,
to answer the points

The yaml script ran when i tried to sync the changes i’d made locally (following the tutorial) to the forked repo, so i saw nothing locally only saw the issue when i watched it in github actions

this error message was shown in the github action log, so on the CI

it caused the login.e2e test to fail and whilst the other passed.

I saw node warnings locally when i ran the npm install command previosuly specifically to do with versions.

no other errors or warnings in the github actions log however the error caused the script to stop so i cant say if there would have been more.

here is the login.e2e code

and here is the yaml script

name: NodeJS CI

on: [push]

jobs:
 build:
   runs-on: windows-latest
   strategy:
     matrix:
       node-version: [18.x]

   steps:
     - name: Checkout repository
       uses: actions/checkout@v4
     - name: Use Node.js ${{ matrix.node-version }}
       uses: actions/setup-node@v2
       with:
         node-version: ${{ matrix.node-version }}
     - name: Unit checks
       run: |
         npm ci
         npm test
     - name: E2E checks
       run: |
         npm start &
         sleep 10
         npx wdio run ./wdio.conf.js
     - name: Build production artifacts
       run: |
         npm run build --if-present

I found increasing the sleep duration after the app started to around 30s fixed issues like this for me.

Thanks i’ll try that. would make sense if the script can’t find the element because it hasnt loaded quick enough.