sorry-cypress / cy2

Integrate Cypress with alternative cloud services like Sorry Cypress or Currents
https://docs.sorry-cypress.dev/cypress-agent/cy2
GNU General Public License v3.0
32 stars 5 forks source link

Unable to use cy.origin command with parallelization on Cypress 12.3 #57

Closed przemdabr closed 1 year ago

przemdabr commented 1 year ago

Before opening, please confirm:

Environment information

Running parallelization on GitLab pipeline: Running with gitlab-runner 14.8.3

 System:
    OS: Linux 5.4 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (48) x64 Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz
    Memory: 112.47 GB / 125.53 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 18.6.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.13.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 105.0.5195.102
    Firefox: 104.0.1
  npmPackages:
    @badeball/cypress-cucumber-preprocessor: ^15.0.0 => 15.0.0 
    @bahmutov/cypress-esbuild-preprocessor: ^2.1.5 => 2.1.5 
    @cypress/angular:  0.0.0-development 
    @cypress/mount-utils:  0.0.0-development 
    @cypress/react:  0.0.0-development 
    @cypress/react18:  0.0.0-development 
    @cypress/svelte:  0.0.0-development 
    @cypress/vue:  0.0.0-development 
    @cypress/vue2:  0.0.0-development 
    @shelex/cypress-allure-plugin: ^2.28.5 => 2.34.0 
    @types/fs-extra: ^11.0.0 => 11.0.0 
    @typescript-eslint/eslint-plugin: ^5.48.0 => 5.48.0 
    @typescript-eslint/parser: ^5.48.0 => 5.48.0 
    allure-js-commons: ^2.0.0-beta.19 => 2.0.0-beta.23 
    cy2: ^4.0.3 => 4.0.3 
    cypress: ^12.3.0 => 12.3.0 
    cypress-file-upload: ^5.0.8 => 5.0.8 
    cypress-iframe: latest => 1.0.1 
    cypress-multi-reporters: ^1.6.2 => 1.6.2 
    cypress-recurse: ^1.27.0 => 1.27.0 
    cypress-slack-reporter: ^1.5.2 => 1.5.2 
    envinfo: ^7.8.1 => 7.8.1 
    esbuild: ^0.16.14 => 0.16.16 (0.14.54)
    eslint: ^8.31.0 => 8.31.0 
    eslint-plugin-cypress: ^2.12.1 => 2.12.1 
    mocha: ^10.2.0 => 10.2.0 
    mochawesome: ^7.1.3 => 7.1.3 
    mochawesome-merge: ^4.2.2 => 4.2.2 
    mochawesome-report-generator: ^6.2.0 => 6.2.0 
    npm-run-all: ^4.1.5 => 4.1.5 
    typescript: latest => 4.9.4 
    uid: ^2.0.1 => 2.0.1 
  npmGlobalPackages:
    allure-commandline: 2.20.1
    corepack: 0.12.0
    npm: 8.13.2
    yarn: 1.22.19

Describe the bug

I have a test where I'm running the app on the x page and then I'm going to the second domain with cy.origin command.

Expected behavior

Open the second domain using cy.origin command as on a single run.

Command and Setup

"test": "npx cy2 run --record --key XXX --parallel --ci-build-id $CI_PIPELINE_ID"

Full log and debug output

``` // Put your logs below this line ```
agoldis commented 1 year ago

Please reopen with a full log

agoldis commented 1 year ago

cy2@4.0.5

CYPRESS_API_URL=https://cy.currents.dev npx cy2 run --parallel --record --key xxx --ci-build-id `date +%s` --spec ./cypress/integration/110.spec.js
// 110.spec.js
describe("Origin", function () {
  it("Runs a test", function () {
    cy.visit("https://google.com/");
    cy.get('[alt="Google"]').should("be.visible");

    cy.origin("https://docs.cypress.io", {}, () => {
      cy.visit("/api/commands/origin#Syntax");
      cy.get("h2").contains("Syntax");
    });
  });
});
 [cy2]  Using cloud orchestration service: https://cy.currents.dev
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.3.0                                                                         │
  │ Browser:        Electron 106 (headless)                                                        │
  │ Node Version:   v16.17.1 (/Users/agoldis/.nvm/versions/node/v16.17.1/bin/node)                 │
  │ Specs:          1 found (110.spec.js)                                                          │
  │ Searched:       cypress/integration/110.spec.js                                                │
  │ Params:         Tag: false, Group: false, Parallel: true                                       │
  │ Run URL:        https://app.currents.dev/run/90362486a5ff7e82faa984c8b173811f                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  110.spec.js                                                                     (1 of 1)

  Origin
    ✓ Runs a test (3111ms)

  1 passing (4s)

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     4 seconds                                                                        │
  │ Spec Ran:     110.spec.js                                                                      │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/agoldis/currents-demo/cypress/videos/110.spec.js.mp4     (1 second)

  (Uploading Results)

  - Done Uploading (1/1) /Users/agoldis/currents-demo/cypress/videos/110.spec.js.mp4

====================================================================================================

  (Run Finished)

       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  110.spec.js                              00:04        1        1        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:04        1        1        -        -        -  

───────────────────────────────────────────────────────────────────────────────────────────────────────

  Recorded Run: https://app.currents.dev/run/90362486a5ff7e82faa984c8b173811f

https://user-images.githubusercontent.com/1637928/211932335-a3b9079b-b16d-48d5-bc17-4832983b1d14.mp4

przemdabr commented 1 year ago

Thank you! With 4.0.5 is working perfectly.