# FCTA\_JS: 2.5.3 Github Action activity failed with error

**URL:** <https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588>\
**Category:** Discussions\
**Tags:** automation, mot-fcta\
**Created:** [28 August 2024 13:53 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588 "2024-08-28T13:53:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![msadler93](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@msadler93](https://club.ministryoftesting.com/u/msadler93)\
**Post date:** [28 August 2024 13:53 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/1 "2024-08-28T13:53:00Z")

</div>

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:

```auto
[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?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/w4dd325/32/13269_2.png) [@w4dd325](https://club.ministryoftesting.com/u/w4dd325)\
**Post date:** [29 August 2024 07:56 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/2 "2024-08-29T07:56:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kristof](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/kristof/32/10839_2.png) [@kristof](https://club.ministryoftesting.com/u/kristof)\
**Post date:** [29 August 2024 08:36 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/3 "2024-08-29T08:36:41Z")

</div>

> [@msadler93](#):
>
> ```auto
> Error: Can't call getText on element with selector ".card-title" because element wasn't found
> 
> ```

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

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

---

<div class="post-metadata">

**Author:** ![msadler93](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@msadler93](https://club.ministryoftesting.com/u/msadler93)\
**Post date:** [29 August 2024 08:42 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/4 "2024-08-29T08:42:49Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ministryoftesting/original/2X/d/d138973d5c632c3f83aed196bfceefe3f34616c7.png)

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.

---

<div class="post-metadata">

**Author:** ![msadler93](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@msadler93](https://club.ministryoftesting.com/u/msadler93)\
**Post date:** [29 August 2024 08:43 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/5 "2024-08-29T08:43:17Z")

</div>

here is the login.e2e code

 ![Screenshot 2024-08-29 at 09.41.32](https://us1.discourse-cdn.com/flex020/uploads/ministryoftesting/original/2X/2/2fadc0d07920ecb119745f886d0f5bb0a3727b62.png)

---

<div class="post-metadata">

**Author:** ![msadler93](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@msadler93](https://club.ministryoftesting.com/u/msadler93)\
**Post date:** [29 August 2024 08:44 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/6 "2024-08-29T08:44:02Z")

</div>

and here is the yaml script

```auto
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

```

---

<div class="post-metadata">

**Author:** ![a\_mcanirn](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/a_mcanirn/32/13559_2.png) [@a\_mcanirn](https://club.ministryoftesting.com/u/a_mcanirn)\
**Post date:** [30 August 2024 06:26 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/7 "2024-08-30T06:26:43Z")

</div>

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

> <https://github.com/amcanirn/mot-cert-support-app-js/blob/trunk/.github/workflows/build_test_react.yml#L29>

---

<div class="post-metadata">

**Author:** ![msadler93](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@msadler93](https://club.ministryoftesting.com/u/msadler93)\
**Post date:** [30 August 2024 08:01 UTC](https://club.ministryoftesting.com/t/fcta-js-2-5-3-github-action-activity-failed-with-error/78588/8 "2024-08-30T08:01:32Z")

</div>

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