https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • g

    glamorous-lighter-30340

    09/07/2022, 3:41 PM
    if you use a ci/cd tool, you could just set it up to run the cypress tests every hour.
  • s

    swift-rain-28843

    09/07/2022, 3:42 PM
    I do have ci available. I was more generally interested if cypress can only test on "localhost" or if I can point it to a URL
  • g

    glamorous-lighter-30340

    09/07/2022, 3:43 PM
    you can point it to a url, just change the baseurl. Here are some ways you could do to making testing of different environments easier: https://docs.cypress.io/guides/guides/environment-variables#Setting
  • s

    swift-rain-28843

    09/07/2022, 3:45 PM
    sweet! thank you very much ❤️ that is exactly what i need to get started
  • g

    glamorous-lighter-30340

    09/07/2022, 3:45 PM
    you bet!
  • b

    bitter-fountain-36713

    09/07/2022, 3:52 PM
    Hi
  • l

    little-france-10142

    09/07/2022, 5:17 PM
    Is there a way to run something in a
    spec
    file in parallel? For instance, I need to simulate a new user creating a new document with some text in it. But I want to test after 50 documents have been made. I do not want to sit around waiting for 50 docs to be created. Is there a way to create all 50 docs in parallel?
  • w

    worried-lifeguard-15953

    09/07/2022, 7:07 PM
    I'm aware of how to create custom commands like
    Cypress.Commands.add('login', (username, pw) => {...})
    But how do I do it when the argument needs to be an actual element? I'm wanting to do something like this that checks every matched element for the conditions (not just the first one that matches).
    Copy code
    Cypress.Commands.add('checkElementClass', (element, class) => {
      element.should('have.class', class);
    });
    
    ...
    
    // Check every <li> has the class
    cy.get('ul>li').each((($el, index, $list)) => {
      cy.checkElementClass($el, 'myClass');
    });
    // or
    cy.get('ul>li').eq(0).as('li0');  cy.checkElementClass(li0, 'myClass');
    // etc.
  • g

    gray-kilobyte-89541

    09/07/2022, 7:10 PM
    create them using API?
  • b

    broad-monkey-14727

    09/07/2022, 8:26 PM
    I am doing the Test Your Application course. Wrote the custom command but get a syntax error when I run the test. In the video he does not get the syntax error. I followed the code exactly so not sure why I'm getting it Syntax error, unrecognized expression: [data-test=${selector}]
  • f

    freezing-wall-7568

    09/07/2022, 9:07 PM
    anyone who used cypress for testing mobile ionic applications, and are there limitations for device hardware, camera, microphone, permissions and etc
  • g

    gray-kilobyte-89541

    09/08/2022, 1:01 AM
    You did backticks (JavaScript template literal)?
    Copy code
    `[data-test=${selector}]`
  • f

    flaky-airport-12178

    09/08/2022, 5:07 AM
    Do you know how to get the index of active element with one command (not loop each)?
  • s

    sparse-kilobyte-59330

    09/08/2022, 6:33 AM
    Hi @here I am trying to get this test case to fail intentionally and it is showing in passing. i am expecting it to be in fail status
  • s

    sparse-kilobyte-59330

    09/08/2022, 6:34 AM
    Can someone help who might have faced the same thing ?
  • a

    acceptable-hamburger-48790

    09/08/2022, 8:09 AM
    An example using jquery way cy.get("ul li.active").then(($el) => { cy.log($el.index()); });
  • i

    incalculable-winter-53928

    09/08/2022, 8:19 AM
    Can I get help here? I have an issue where for some reason, the third call of this function doesn't intercept the correct request. If you look at the second picture, the number 27 is called twice even tho it shouldn't
  • i

    incalculable-winter-53928

    09/08/2022, 8:20 AM
    The parameter that I passed to the function is another number, that is why when I run the commented out code
    expect(setStatusRequest.body.merchantIds[0]).to.equal(merchant.merchantId);
    The test fails, because for some reason, the request still has the values from the previous one
  • g

    gray-kilobyte-89541

    09/08/2022, 11:30 AM
    https://github.com/bahmutov/cypress-examples/commit/dd3023bbd69eb675e19abed06b1cae45755a22cd
  • b

    broad-monkey-14727

    09/08/2022, 11:36 AM
    I don't know what you mean by backticks. I don't understand the relationship between the template and literal. There was no template in the tutorial. I copied the Cypress.command code exactly. It is frustrating when the video shows it running green but when I do it I get the syntax error and there is no one to explain the problem. I guess I just won't use custom commands.
  • f

    flaky-airport-12178

    09/08/2022, 11:36 AM
    Thanks @gray-kilobyte-89541 but I want to return the index number
  • b

    bright-kangaroo-34963

    09/08/2022, 1:00 PM
    how to check existance without failing?
  • s

    stale-optician-85950

    09/08/2022, 2:08 PM
    https://docs.cypress.io/guides/core-concepts/conditional-testing
  • g

    gray-kilobyte-89541

    09/08/2022, 2:13 PM
    Can you provide at least the video or link to the web page with the code snippet?
  • g

    gray-kilobyte-89541

    09/08/2022, 2:13 PM
    what do you mean "i want to return the index number"? Like - into
    .then(index =>
    after invoking the
    index
    method?
  • b

    bitter-fountain-36713

    09/08/2022, 2:14 PM
    Reuses function with intercept
  • f

    flaky-airport-12178

    09/08/2022, 3:08 PM
    Yes
  • s

    silly-exabyte-39686

    09/08/2022, 3:09 PM
    Please help me!. I am working with E2E test for Webflow site. I am testing with cy.visit() function to open the remote page but it doesn't work for correct styling with original home page. I share the screenshot fir it. Can you help me to let me know how to import the existing styles so that it can be seen from existing home page. I have all page in my local for Webflow site.
  • b

    broad-monkey-14727

    09/08/2022, 3:20 PM
    I'm working on localhost so no web page. Here's the code for the 3 files support/commands.ts /// Cypress.Commands.add("getByData", (selector) => { return cy.get('[data-test=${selector}]') }) support/index.ts declare namespace Cypress { interface Chainable { getByData(dataTestAttribute: string): Chainable<JQuery> } } e2e/home.ts describe('home page', () => {beforeEach(() =>{ cy.visit('http://localhost:3000') }) it('the h1 contains the correct text', () => { cy.getByData('hero-heading').contains('Testing Next.js Applications with Cypress') }) it('the features on the home page are correct', () => { cy.get("dt").eq(0).contains("4 Courses") cy.get("dt").eq(1).contains("25+ Lessons") cy.get("dt").eq(2).contains("Free and Open Source") }) Error Syntax error, unrecognized expression: [data-test=${selector}]
  • b

    broad-monkey-14727

    09/08/2022, 3:23 PM
    I've removed the custom command and using the regular element name. The script works as expected when I do that.
1...979899...192Latest