3.3.2: Resolving Failed Checks: GitHub Action failed to run

I am working on the Foundation Certificate and am currently on module 3.3.2

I have fixed the tests and they are passing locally- but unfortunately I can’t work out why CI won’t build /Pass.

My Repo is here if anyone can see something obvious I am missing!

Thank you in advance.

1 Like

So the last GitHub Actions run you have seemed to fail due to the test should show projects after creation, where you check the table length - mot-cert-support-app-js/test/specs/Projects.e2e.js at main · K10hrn/mot-cert-support-app-js · GitHub. I also see this issue when running locally.

I haven’t used WDIO in ages and couldn’t find a nice way to get the table element, so I just added a testid to save me the grief. I tried pushing the code to your repo but it must have access locked down.

Update the below:

To:

<ul className="list-group" data-testid="project-table">

Then update your test to:

const projectTableRows = await $$('ul[data-testid="project-table"] tr')
expect(projectTableRows).toBeElementsArrayOfSize(2);

If that doesn’t work let me know and I can help you walk through the issues.

1 Like

What @a_mcanirn has suggested is a good place to start @kelly.kenyon. Any issues though, let me know and I’ll see how I can help now that I am back from break :slight_smile:

1 Like

Thank you!

Where would I put the new code/ will I need to remove any existing for the test?

The issue you are having appears to be around getting the table element for checking if 2 rows exist.

You could either update your locator or implement the test id option I mention above. The link above is for your repo and should take you to line 30 of mot-cert-support-app-js/blob/main/src/components/ProjectList.js. Update that line to <ul className="list-group" data-testid=" and you can then use the locator $$('ul[data-testid="project-table.

Let me know how you get on.

1 Like

Thank you so much, this has worked a dream!

2 Likes