https://cypress.io logo
Join Discord
Powered by
# help
  • g

    gray-kilobyte-89541

    09/28/2022, 7:52 PM
    yeah, can you try it without
    .have
    , I guess it is the dots, here is my example of custom assertion in Cypress https://glebbahmutov.com/blog/custom-assertions/
  • f

    freezing-wall-7568

    09/28/2022, 8:44 PM
    retryOnNetworkFailure argument on cy.request, will it retry the requests automatically if the server responds 503 Service Unavailable ?
  • f

    freezing-wall-7568

    09/28/2022, 8:44 PM
    or shall I use retryOnStatusCodeFailure property instead?
  • f

    freezing-wall-7568

    09/28/2022, 8:46 PM
    failOnStatusCode property passed is default which is true
  • f

    fancy-mechanic-10638

    09/28/2022, 10:20 PM
    Ok that’s hilarious. Your article is what I learned how to do this from this morning!
  • a

    alert-wolf-13579

    09/29/2022, 5:50 AM
    hi I am stuck with something little I am trying to do but just can't figure it out! I found my element and I want to get the text inside and store as a variable. I tried: cy.get('h1') .contains(EXPECTED_HEADING) .should('be.visible') .invoke('val').as('headingtext'); cy.log('@headingtext');
  • a

    acceptable-hamburger-48790

    09/29/2022, 5:59 AM
    Did you check aliases ? in cypress everything is chained command, so you cant go with regular way of returning values. Give this a read https://docs.cypress.io/guides/core-concepts/variables-and-aliases
  • a

    acceptable-hamburger-48790

    09/29/2022, 6:01 AM
    also for text it would be .invoke("text")
  • a

    acceptable-hamburger-48790

    09/29/2022, 6:02 AM
    and to fetch the alias you would usually need to use cy.get("@aliasName")
  • h

    hallowed-machine-45508

    09/29/2022, 9:09 AM
    Hey, I just recently upgraded to Cypress v10.9.0 to implement the new component testing for Angular. However, I can not find any advice on how to use injected service classes in component tests. My PageHeaderComponent uses the ScreenService class which is injected in the constructor of the PageHeaderComponent. Also the customMount is implemented, so the declaration is not missing 🙂 The following code gives me the error --> "NullInjectorError: No provider for ScreenService!" import {PageHeaderComponent} from "./page-header.component"; describe('PageHeaderComponent', () => { it('mounts', () => { cy.mount(
    <app-header></app-header>
    ); }); });
  • l

    loud-australia-8985

    09/29/2022, 12:59 PM
    Did you manage to a component test to run that uses Quasar components?
  • e

    enough-tent-11494

    09/29/2022, 1:22 PM
    Hi I just wanted to ask if we can automate features on esri webmaps?
  • c

    cool-toothbrush-53313

    09/29/2022, 3:27 PM
    Is anybody facing this issue after migrating to @freezing-piano-2792/cypress-cucumber-preprocessor. Looks like And keyword is removed. Any alternative. The following error originated from your test code, not from Cypress. > (0 , import_cypress_cucumber_preprocessor.And) is not a function When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure.
  • a

    acceptable-hamburger-48790

    09/29/2022, 3:29 PM
    What will happen if you use When in the Step definition(Instead of And) and And in feature file ?
  • m

    mysterious-belgium-25713

    09/29/2022, 3:33 PM
    If you look at the release notes you can see that AND is removed. You should just use WHEN or Then instead of and and and
  • c

    cool-toothbrush-53313

    09/29/2022, 3:35 PM
    Thanks, it works. But we have too many automation scripts to be changed. Looks like no other option other than changing them to When or Then
  • m

    mysterious-belgium-25713

    09/29/2022, 3:43 PM
    @cool-toothbrush-53313, you can also use version v12.2.0 of @freezing-piano-2792/cypress-cucumber-preprocessor. This is the version before he removed the AND statement
  • m

    mysterious-belgium-25713

    09/29/2022, 3:44 PM
    And you can slowly start changing your scripts to remove the AND feature if you are going to use the latest version somewhere in time
  • f

    fierce-activity-35946

    09/29/2022, 7:48 PM
    Hi all, I wonder if anyone has used
    cypress-terminal-report
    with latest Cypress versions? It doesn't print console logs to terminal and I wonder if this looks familiar to someone?
    Copy code
    support/e2e.js
    
    import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector'
    
    const terminalReportOptions = {
      // Log console output only
      collectTypes: ["cons:log", "cons:info", "cons:warn", "cons:error"],
      xhr: {
        printHeaderData: true,
        printRequestData: true
      }
    };
    
    installLogsCollector(terminalReportOptions)
    
    setupNodeEvents config
    require('cypress-terminal-report/src/installLogsPrinter')(on, { printLogsToConsole: 'always'});
  • a

    abundant-dentist-45237

    09/29/2022, 8:12 PM
    How do I change my profile email? I cannot enter a new email. It only lists the one already used and cannot be edited.
  • f

    fancy-mechanic-10638

    09/29/2022, 9:39 PM
    How do I set baseUrl when doing component testing? I see the
    e2e: { baseUrl: '...' }
    for end to end, but not for component.
  • m

    mysterious-belgium-25713

    09/29/2022, 9:51 PM
    For component testing you are not visiting urls. You are mounting single components and test them. You are not doing a live integration/e2e test
  • f

    fancy-mechanic-10638

    09/29/2022, 10:07 PM
    But when it mounts, the ngOnInit for example runs, which makes a network call, which then fails.
  • b

    breezy-fountain-29456

    09/29/2022, 10:14 PM
    I'm trying to install Cypress inside my React.js project and it's giving me .ts files, any idea what's going on here? There's no TS in this project.
  • d

    dazzling-pillow-26039

    09/30/2022, 12:04 AM
    Use intercept here and mock the response
  • f

    fancy-mechanic-10638

    09/30/2022, 12:05 AM
    That’s exactly what I’m doing via a fixture. But it’s not using the baseUrl like the e2e setup does.
  • d

    dazzling-pillow-26039

    09/30/2022, 12:18 AM
    Component tests will not use base url. As the same suggests it’s for e2e only. I believe the url is not being intercepted properly. Rather use wild cards to intercept the url properly. Use the route instead.
  • h

    happy-dinner-6848

    09/30/2022, 8:07 AM
    So apparently we can't use cy.visit inside a component testing Let's say I'm testing a link component and I want to see its behavior in a specific pathname, how can I do so?
  • a

    astonishing-kangaroo-73759

    09/30/2022, 8:12 AM
    Hello, I am new to cypress and I got a question. So I wanne create a dashboard on a custom domain where I can see the uptime from a server and if all function I wanne test are working. So i was wondering if that is possible with cypress?
  • b

    brief-ghost-86635

    09/30/2022, 10:23 AM
    Hi Team. In Cypress we are getting a "Request URL too long HTTP error 414: The request url is too long " Please help
1...157158159...252Latest