'Github Actions running both .Net Core and Ant Design Pro
I want to be able to run both .NET core and ant design pro (React) using Cypress Github Actions but however, I have the problem below:
Problem:
- Error message: AssertionError: Timed out retrying after 4000ms: Expected to find element:
.ant-pro-table-list-toolbar-right > :nth-child(1) > .ant-space > [style=""] > .ant-btn, but never found it.
It was running smoothly on localhost but couldn't work on github actions. Steps that I took to run locally:
- type "dotnet run"
- type "yarn start"
and it is able to run locally.
cypress.js
describe('test button', () => {
it('Create application',() => {
cy.visit('http://localhost:8000/Application')
cy.get('.ant-pro-table-list-toolbar-right > :nth-child(1) > .ant-space > [style=""] > .ant-btn').click()
}
main.yml
name: Cypress
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
working-directory: dotnet
dotnet-version: 5.0.404
run: dotnet run --no-restore
- name: Cypress tests
uses: cypress-io/github-action@v2
with:
working-directory: my-app
browser: chrome
record: true
build: yarn run build
start: yarn start
wait-on: 'http://localhost:8000'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
DEBUG: "@cypress/github-action"
Hope to have someone to help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
