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

    dazzling-pillow-26039

    10/12/2022, 4:23 PM
    There must be a check your app does to send notification either as a cookie or local storage. Confirm with developer what is it and add it prior your test.
  • g

    great-london-82425

    10/12/2022, 4:56 PM
    Hi @agreeable-scooter-87343. For the past three months, our GitHub Actions Cypress suite has been inconsistent. For example, for every push we do, it runs the suite and I'll have to manually re-run because it won't locate our tests (error reads
    Could not find Cypress test run results
    ). It used to be fine, if a bit flakey. There have also been times when our suite takes twice the time to load when it does locate the tests automatically so it's becoming a performance issue as well. When there's a flakey test on GitHub Actions, there's no way for us to debug to resolve (whereas CircleCI does let you SSH into a container to figure out what's going on when there is a flakey test).
  • l

    loose-engine-11181

    10/12/2022, 7:47 PM
    I'm trying to create two cy.session calls that take the same parameters (email and password) but have different behaviors (setup). One for registering a test user, the other logging them on. Cypress complains
    Copy code
    You may not call cy.session() with a previously used name and different options. If you want to specify different options, please use a unique name other than
    I don't have different options specified, so I'm assuming that it's complaining about the two setups, which shouldn't be an issue. Does anyone have any experience with this?
  • g

    glamorous-waiter-41005

    10/12/2022, 9:24 PM
    I am trying to get shopify card details elements on UI, and cypress is not able to locate the input inside the iframe. Can someone help me in this? TIA
  • c

    calm-house-97322

    10/12/2022, 10:16 PM
    I've had success with this when testing iframes https://www.npmjs.com/package/cypress-iframe
  • a

    abundant-lifeguard-9043

    10/13/2022, 9:16 AM
    I am trying to get shopify card details
  • q

    quick-painting-17010

    10/13/2022, 11:24 AM
    Hello, please help, on the test site, to load some elements, authorization from another site is required, I can’t make it work, I tried to include elements from the test in the session, but it didn’t help.
  • a

    acceptable-hamburger-48790

    10/13/2022, 11:36 AM
    Did you check cy.origin https://docs.cypress.io/api/commands/origin
  • q

    quick-painting-17010

    10/13/2022, 12:07 PM
    I can't figure out how cy.origin should help me, can you give an example by inserting it into my code ```const dataJson = 'data/data.json'; var data; const login = (email) => { //It's working fine cy.session(email, () => { cy.visit('https://mysite.com') cy.get('#LoginForm_email').type(email); cy.get('#LoginForm_password').type(data.password, { log: false }); cy.get('#login-btn').click(); }) } describe('test', () => { beforeEach(function () { cy.fixture(dataJson).then((json) => { data = json; }) cy.viewport(1400, 900); }) it.only('test1', () => { login(data.mail); cy.visit('https://mysite.com') //Login goes well and the site enters cy.visit('https://login:password@https://sekondsite.com'); //On the other site, authorization is required and it also works fine cy.visit('https://sekondsite.com', { //This authentication also works. auth: { username: 'login', password: 'password', }, }); cy.visit('https://login:password@mysite.com/item'); //When you go to this page, it loads, but some elements require //authorization on the site "sekondsite.com" to load, and here authorization no longer works cy.visit('https://mysite.com/item', { //This option doesn't work either. auth: { username: 'login', password: 'password', }, }); }); })```js
  • s

    stale-optician-85950

    10/13/2022, 12:09 PM
    You haven't even used
    cy.origin()
    in your code, follow the documentation examples https://docs.cypress.io/api/commands/origin
  • q

    quick-painting-17010

    10/13/2022, 1:19 PM
    I have already tried many ways, where I just didn’t insert cy.origin() into my code, I re-read the documentation 5 times, forgive me, I’m very stupid, I don’t understand how to properly embed cy.origin() into my code
  • b

    bright-twilight-10346

    10/13/2022, 1:33 PM
    Can Cypress be used for Salesforce testing ? The XPaths/Test Locators constantly change with every Salesforce release which impacts the automation done using Selenium , Does Cypress has a solution for this ?
  • b

    bright-twilight-10346

    10/13/2022, 1:52 PM
    Salesforce Testing Using Cypress
    • 1
    • 1
  • f

    fresh-doctor-14925

    10/13/2022, 1:55 PM
    @bright-twilight-10346 If the test locators change with every release, and you can't add your own test ids, then there's not much that can be done with Cypress (or any tool, for that matter). It's something that should be addressed on the Salesforce side. Presumably your org is paying for Salesforce and has an account manager that you can raise the issue with?
  • b

    bright-twilight-10346

    10/13/2022, 2:13 PM
    got it , thanks for the response
  • b

    bright-twilight-10346

    10/13/2022, 2:13 PM
    got it , thanks for the response
  • b

    bright-eve-71344

    10/13/2022, 2:18 PM
    it('successfully logs in via API', () => { cy.request('POST',
    http://localhost:4000/users/login
    , { user: { email: "USERNAME", password: "PASSWORD" } }).then(({ body }) => { window.localStorage.setItem('__auth_provider_token__', body.token) cy.visit('/profile') cy.get('h1').contains('Account') }) Doing a basic API login test to programmatically login to my application. The API is going through, but the page in the cy.visit() is not rendering. It's a white blank page. Looking at the screen shots I noticed a few xhr requests getting aborted. I can't figure out why or how. If I run the test locally, my tests all pass and work as expected.
  • s

    stale-optician-85950

    10/13/2022, 2:26 PM
    1. You might be over complicating your test by visiting all these different URLs in one
    it
    block? Are you able to separate out the test into muliple smaller
    it
    blocks, each with a more specific validation? 2. Your example code comments say that
    cy.visit('https://mysite.com/item'
    doesn't work but you have already visited
    https://mysite.com
    and that does work. But they have the same URL origin. I suggest you try to simplify your code using 2 URLs with different origins and get
    cy.origin
    working there first.
  • w

    worried-tomato-61061

    10/13/2022, 3:08 PM
    hi team I am having issues in confirm pop nn embedded pages. cypress stops as soon as pop up displayed. How to click OK on pop up please. Your much appriciated
  • q

    quick-painting-17010

    10/13/2022, 3:37 PM
    Perhaps I expressed myself incorrectly, and in the test I gave too many examples of how I tried to do this. In fact, I only need to visit one page https://mysite.com/item, but when the page loads, images are loaded that are on another page https://sekondsite.com/ which requires authorization. It turns out that authorization does not appear at the very beginning before the page is loaded, but in the middle, when pictures from another site begin to load. Yes, the site is a curve, but what is it. I still don’t understand how cy.origin should help me here.
  • b

    big-judge-93427

    10/13/2022, 5:23 PM
    Hello. I'm hoping someone can help me with putting text into the left side of the Cypress UI. I know that putting text into the describe method accomplishes this, but I want to be able to format and display text at different parts of my test instead of putting it all out there before the test starts. I'm pretty sure the cucumber plugin does something like this but I'm not sure from looking at their code how it happens. Is there an undocumented method anywhere that would do this, or can someone point me in the direction of where in the code I could begin to create a plugin to do this?
  • f

    fresh-doctor-14925

    10/13/2022, 6:35 PM
    Would
    cy.log()
    be helpful for you?
  • b

    big-judge-93427

    10/13/2022, 6:43 PM
    No, because it only puts it as logging under the description. I want it front-and-centered during all tests that run
  • s

    stale-optician-85950

    10/13/2022, 6:50 PM
    Something like this blog https://filiphric.com/improve-your-custom-command-logs-in-cypress by @nutritious-restaurant-91514
  • b

    big-judge-93427

    10/13/2022, 6:56 PM
    Not really. I want to be able to put the text in that example that is 'Creates a new board'
  • b

    big-judge-93427

    10/13/2022, 6:57 PM
    basically i want to build the message that you get from this
    it('Here is some text', () => cy.doAThing())
  • s

    stale-optician-85950

    10/13/2022, 6:57 PM
    That's an unusual scenario, to say the least. So
    https://mysite.com/item
    is your baseUrl and you need to visit
    https://sekondsite.com/
    for additional authentication. I would have expected a test flow like this: * Login
    https://mysite.com/item
    (as your code is above) * Validate that the page has fully loaded using
    cy.request()
    * Validate the state of the images that are waiting to load (the process will depend on your app) *
    cy.origin()
    into
    https://sekondsite.com/
    and authenticate * Come back to
    https://mysite.com/item
    * Validate that the images have now loaded (the process will depends on your app)
  • s

    stale-optician-85950

    10/13/2022, 7:00 PM
    I use a custom logging like this:
    Copy code
    Cypress.Commands.add('customLogging', (name: string) => {
      Cypress.log({
        consoleProps() {
          return {
            'step name': name,
          };
        },
        displayName: 'test step',
        message: `**${name}**`,
        name: 'UI step currenly under test',
      });
    });
    Which I call to make text stand out more in the Cypress (left side) command log. I don't know if will help you, or if you can pimp it up more for your needs.
    cy.customLogging('Site Loaded');
  • b

    big-judge-93427

    10/13/2022, 7:01 PM
    The logs disappear once a test has completed right?
  • s

    stale-optician-85950

    10/13/2022, 7:04 PM
    The logs remain on screen until I re-run the test or start a new test etc same as default logs behaviour. And they are seen in screenshots in CI, as I have a few very large tests and this logging made it easier to see exactly where the issue occured.
1...120121122...192Latest