Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests always failling in GitHub Actions #30183

Open
fabu1985 opened this issue Sep 4, 2024 · 15 comments
Open

Tests always failling in GitHub Actions #30183

fabu1985 opened this issue Sep 4, 2024 · 15 comments
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@fabu1985
Copy link

fabu1985 commented Sep 4, 2024

Current behavior

This is my job :

cypres_test:
  runs-on: ubuntu-22.04
  name: Cypress Tests
  steps:
    - uses: actions/checkout@v4
      with:
        submodules: true

    # Setup Yarn Berry
    - name: Set up Yarn
      run: |
        npm install -g yarn@berry
        yarn set version berry
        yarn --version

    # Install dependencies
    - name: Install dependencies
      run: yarn install --frozen-lockfile

    - name: Build And Deploy
      id: builddeploy
      uses: Azure/static-web-apps-deploy@v1
      with:
        azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_SEA_0E6F37A10 }}
        repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
        action: "upload"
        app_location: "/" # App source code path
        api_location: "" # Api source code path - optional
        output_location: "dist" # Built app content directory - optional
        app_build_command: "yarn build:mocked" # Comando de build personalizado
        skip_app_build: false
        skip_api_build: true

    # Run Cypress tests
    - name: Run Cypress Tests
      uses: cypress-io/github-action@v6
      env: 
        EEO_AUTOMATION_BASE_URL: https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net
      with:
        config: 'baseUrl=https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net'
        command: yarn automation:e2e
        wait-on: 'https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net'
        wait-on-timeout: 110

So, the result is always the same

AssertionError: Timed out retrying after 0ms: Expected to find element: `[data-testid^="welcomeHeader"]`, but never found it.

Desired behavior

No response

Test code to reproduce

https://github.com/fabu1985/algo/actions/runs/10704642103/job/29678128833?pr=12

Cypress Version

13.14.1

Node version

20.14.0

Operating System

ubuntu

Debug Logs

No response

Other

I check it running a simple test against Google page, and worked ok. It´s means the latest versions for cypress and libraries updated, are not the problem, aparently.
I harcoded the baseurl and the problem still happening.

I´ll appreciatte u any idea o suggestion... thanks!!!

@jennifer-shehane
Copy link
Member

There's not much for us to look into on our side for this. This element is not being found for some reason. Test Replay is a good way to debug failures in CI as it replays entirely what happened where you can visually see it.

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Sep 4, 2024
@MikeMcC399
Copy link
Contributor

@fabu1985

See https://github.com/cypress-io/github-action/blob/master/README.md#custom-test-command

image

Using command switches off most of the functionality of the action. I can't tell if this is your problem however.

Take a look at the examples in https://github.com/cypress-io/github-action/blob/master/README.md to see how the action is intended to be used.

https://github.com/fabu1985/algo/actions/runs/10704642103/job/29678128833?pr=12 is not readable: 404 error - probably a private repository. You need to make it public if you want anybody to look at it.

@fabu1985
Copy link
Author

fabu1985 commented Sep 4, 2024

There's not much for us to look into on our side for this. This element is not being found for some reason. Test Replay is a good way to debug failures in CI as it replays entirely what happened where you can visually see it.

I debugged it, I tried visiting the Google hompeage and everything is ok. The problem it´s only with my tests against the builded page. Locally, they are running succesfully

@fabu1985
Copy link
Author

fabu1985 commented Sep 4, 2024

@fabu1985

See https://github.com/cypress-io/github-action/blob/master/README.md#custom-test-command

image

Using command switches off most of the functionality of the action. I can't tell if this is your problem however.

Take a look at the examples in https://github.com/cypress-io/github-action/blob/master/README.md to see how the action is intended to be used.

https://github.com/fabu1985/algo/actions/runs/10704642103/job/29678128833?pr=12 is not readable: 404 error - probably a private repository. You need to make it public if you want anybody to look at it.

@MikeMcC399 I created a test to check the Google Homepage, and it´s ran ok. The tests thar are running against the builded page still failling.

@MikeMcC399
Copy link
Contributor

@fabu1985

I created a test to check the Google Homepage, and it´s ran ok. The tests thar are running against the builded page still failling.

There is no new information in this issue to allow further analysis.

The only information is the error message:

AssertionError: Timed out retrying after 0ms: Expected to find element: `[data-testid^="welcomeHeader"]`, but never found it.

@fabu1985
Copy link
Author

fabu1985 commented Sep 5, 2024

@fabu1985

I created a test to check the Google Homepage, and it´s ran ok. The tests thar are running against the builded page still failling.

There is no new information in this issue to allow further analysis.

The only information is the error message:

AssertionError: Timed out retrying after 0ms: Expected to find element: `[data-testid^="welcomeHeader"]`, but never found it.

@MikeMcC399 let me tell u that I did some changes, like as:

  • increase the timeout.
  • use 'id' or some css 'path', instead data-testid
    not succes.

This is the static azure page, you can see that the page is ok:
https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net/

This is the particular command that I use
"automation:e2e": "cypress run --browser chrome --headless --spec 'automation/cypress/e2e/eventCards.feature'"

Here the last GitHubActions output
image

@MikeMcC399
Copy link
Contributor

@fabu1985

It seems that you are having a problem using cypress-cucumber-preprocessor. Which version are you using?

When I view https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net/ in Google Chrome, it first displays content, then it displays only a blank page.

@fabu1985
Copy link
Author

fabu1985 commented Sep 5, 2024

@fabu1985

It seems that you are having a problem using cypress-cucumber-preprocessor. Which version are you using?

When I view https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net/ in Google Chrome, it first displays content, then it displays only a blank page.

I´m use "cypress-cucumber-preprocessor": "^4.3.1"
Why do you think that is Cucumber version the problem? I left this idea, ´cause the test that check the logo on the google homepage, passed ok. or am I confused?
regarding the blank page, maybe was ´cause I was running the jobs here. You can check it now mad you should not have problems.

@MikeMcC399
Copy link
Contributor

@fabu1985

I´m use "cypress-cucumber-preprocessor": "^4.3.1"

This is an old version which has been replaced by @badeball/cypress-cucumber-preprocessor. See badeball/cypress-cucumber-preprocessor#689

This topic is however outside of the scope of a Cypress bug report in this issue list.

@fabu1985
Copy link
Author

fabu1985 commented Sep 5, 2024

@fabu1985

Estoy usando "cypress-cucumber-preprocessor": "^4.3.1"

Esta es una versión antigua que ha sido reemplazada por @badeball/cypress-cucumber-preprocessor . Ver badeball/cypress-cucumber-preprocessor#689

Sin embargo, este tema está fuera del alcance de un informe de errores de Cypress en esta lista de problemas.

ok, understood. My question is, why do you think that the problem is cucumber-preprocessor?

@MikeMcC399
Copy link
Contributor

@fabu1985

ok, understood. My question is, why do you think that the problem is cucumber-preprocessor?

There isn't enough information available in this issue to say where the problem lies. If there is a product bug then in most cases you will be asked to test on the latest Cypress version or Cypress plugin version to confirm that it is not a problem which is already solved.

Considering that your error is not being able to find an element and the URL https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net/ continues to show a blank page when I view it, you may want to check whether it is displaying the content that you expect.

@fabu1985
Copy link
Author

fabu1985 commented Sep 6, 2024

@fabu1985

Ok, entendido. Mi pregunta es ¿por qué crees que el problema es del preprocesador de pepino?

No hay suficiente información disponible sobre este problema para determinar dónde se encuentra. Si hay un error en el producto, en la mayoría de los casos se le solicitará que realice una prueba en la última versión de Cypress o en la versión del complemento de Cypress para confirmar que no se trata de un problema que ya se haya solucionado.

Teniendo en cuenta que tu error es no poder encontrar un elemento y la URL https://calm-sea-0e6f37a10-139.centralus.3.azurestaticapps.net/ sigue mostrando una página en blanco cuando la veo, es posible que quieras verificar si está mostrando el contenido que esperas.

@MikeMcC399 just in case, can you try to open the site in chrome, please? I'm almost sure you're using a different browser than Chrome, right? For rome developed reason the site worked ok in chrome, chromium, electron. but not for another browser.That's why I make sure that when running the githubactions I use the chrome browser

@MikeMcC399
Copy link
Contributor

@MikeMcC399 just in case, can you try to open the site in chrome, please?

As I wrote in #30183 (comment), I am using Google Chrome. Currently I have Version 128.0.6613.120 (Official Build) (64-bit) installed.

@fabu1985
Copy link
Author

fabu1985 commented Sep 6, 2024

@MikeMcC399 just in case, can you try to open the site in chrome, please?

As I wrote in #30183 (comment), I am using Google Chrome. Currently I have Version 128.0.6613.120 (Official Build) (64-bit) installed.

So, let me tell u that I replaced the "cypress-cucumber-preprocessor": "^4.3.1" by @badeball/cypress-cucumber-preprocessor, as you suggested me. Also, I increase the timeout...and still not working:

image

the tests agaisnt the azure static page failt.

@MikeMcC399
Copy link
Contributor

@fabu1985

Please consider the original #30183 (comment) from the Cypress.io team:

There's not much for us to look into on our side for this. This element is not being found for some reason. Test Replay is a good way to debug failures in CI as it replays entirely what happened where you can visually see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

3 participants