https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • p

    polite-garage-57372

    12/20/2022, 5:01 PM
    "cy:open": "cypress open --config-file=cypress/configs/$npm_config_env.config.ts"
  • p

    polite-garage-57372

    12/20/2022, 5:01 PM
    There might be cleaner ways to do this too! I don't love this for something like specs cause it breaks tab completion.
  • h

    hundreds-rainbow-52802

    12/20/2022, 5:14 PM
    Hello Folks, do you know btw how to pass the env on the describe of spec file? I saw this variable here and I wish to use
  • s

    strong-football-17493

    12/20/2022, 5:29 PM
    Hello! Looks like you can as described in guide here : https://docs.cypress.io/guides/guides/environment-variables#Suite-of-test-configuration
    describe('TEST PLAN', { env: { yourKey: 'yourValue' } }, () => { ... });
  • h

    hundreds-rainbow-52802

    12/20/2022, 6:12 PM
    Ummm.. Thanks a lot..!!!
  • h

    hundreds-rainbow-52802

    12/20/2022, 6:18 PM
    But other question, if I want to get the env from json file in the test configuration?
  • h

    hundreds-rainbow-52802

    12/20/2022, 6:55 PM
    Maybe something like that: describe('TEST PLAN', { failFast: { enabled: true }, browser: 'electron', env:{ test: Cypress.env('dev')} }, () => {})
  • h

    hundreds-rainbow-52802

    12/20/2022, 7:04 PM
    Because my cypress.env.json are like that: { "env": { "dev": { "service1MS": { "envUrl": "http://www.test.com" }, "service2MS": { "envUrl": "http://www.test2.com" } } } }
  • s

    straight-rose-89671

    12/21/2022, 9:48 AM
    How can you chain further when having multiple elements ? Example, the getBySel get 5 elements and i want to do stuff on the highlighted one:
    Copy code
    cy.getBySel('test-wrapper')
         .should("have.length.greaterThan", 1)
         .and('have.class', 'highlight')
         .then(() => { 
             cy.get('.highlight')
             .should("be.visible");
     })
    Nvm found how.. lol
  • f

    fresh-doctor-14925

    12/21/2022, 9:51 AM
    You can perform actions on each of them in turn by using
    each()
  • r

    ripe-traffic-15039

    12/21/2022, 11:07 AM
    Hi, I've been having this problem for 2 days. Since I updated cypress to version 12 I have problems. The second test goes blank and I can't continue.
  • r

    ripe-traffic-15039

    12/21/2022, 11:08 AM
    in the cypress.config.js file I have " testIsolation: false,"
  • r

    ripe-traffic-15039

    12/21/2022, 11:08 AM
    Cypress.Commands.add('beforeEach', () => { cy.login(username, password); })
  • r

    ripe-traffic-15039

    12/21/2022, 11:09 AM
    Cypress.Commands.add('login', (username, password) => { cy.session([username, password], () => { cy.wrap(null) .then(() =>{ cy.visit(url); }).then(() => { login.email().type(username); login.password().type(password); login.btnLogIn().click(); }) cy.url().should('contain', '/#/home') } ) })
  • r

    ripe-traffic-15039

    12/21/2022, 11:09 AM
    the first IT ok but the second when I do the visit it doesn't work it stays blank
  • r

    ripe-traffic-15039

    12/21/2022, 11:10 AM
    Can somebody help me?
  • f

    fresh-doctor-14925

    12/21/2022, 11:12 AM
    You shouldn't be doing
    Cypress.Commands.add('beforeEach')
    for starters
  • t

    thankful-wire-37848

    12/21/2022, 11:12 AM
    Not sure what your problem is but this is not how you use beforeEach:
    Cypress.Commands.add('beforeEach'...
  • t

    thankful-wire-37848

    12/21/2022, 11:15 AM
    So you probably want to remove that beforeEach command and just do
    beforeEach(() => cy.login())
    instead
  • r

    ripe-traffic-15039

    12/21/2022, 11:17 AM
    this is my test:
  • r

    ripe-traffic-15039

    12/21/2022, 11:18 AM
    describe("Regression Tests CDP GDPR", () => { var completeDate = 0 var constants = "" before(() => { cy.before() }); beforeEach(() => { cy.beforeEach() cy.getPlatformLanguageConstants().then(value => constants = value); }) it('CDP-4071 GDPR - Consent Version. Edit Terms and Conditions', () => { cy.getCodeTime().then(value => completeDate = value); cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link) cy.then(() => { cy.textArea_TypeAndSave(warehouse.editableTermsConditions(),completeDate,warehouse.btnSaveTermsConditions()) }); cy.clickModalConfirmation() cy.wait(1000) cy.checkModal(constants.cdp.gdprModalTermsConditionsTitle,constants.cdp.gdprModalTermsConditions) cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link) cy.then(() => { cy.checkText(warehouse.editableTermsConditions(),completeDate) }) }); it('CDP-4072 GDPR - Consent Version. Edit Personalized communications', () => { cy.getCodeTime().then(value => completeDate = value); cy.visitUrl(Cypress.env('urls').cdp.complianceVersions.link)
  • r

    ripe-traffic-15039

    12/21/2022, 11:19 AM
    when the visit of the second test arrives cypress shows me this:
  • r

    ripe-traffic-15039

    12/21/2022, 11:20 AM
    the page stays blank
  • r

    ripe-traffic-15039

    12/21/2022, 11:20 AM
    That's my problem, like I don't do the visit
  • t

    thankful-wire-37848

    12/21/2022, 12:42 PM
    Can you try to run only that second test (with
    it.only(...)
    ) so you check if the problem is in the test or in the setup
  • r

    ripe-traffic-15039

    12/21/2022, 12:44 PM
    Liam solved the problem for me, it had to do with the beforeEach Thanks!!
  • s

    sticky-energy-17458

    12/21/2022, 4:35 PM
    I have logged two element's text and want if condition block to be implemented if these two logged values are not same
  • a

    astonishing-window-24437

    12/21/2022, 4:36 PM
    hi all, @shelex/cypress-allure-plugin not created allure results folder when i used import 'cypress-if' plugin.
  • a

    astonishing-window-24437

    12/21/2022, 4:37 PM
    When I comment 'import cypress-if' it works correctly
  • a

    astonishing-window-24437

    12/21/2022, 4:38 PM
    @gray-kilobyte-89541
1...172173174...192Latest