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

    gifted-jackal-27275

    10/12/2022, 3:02 PM
    oh interesting. so i noticed - its trying to run the preview task. "preview": "vite preview --port 4173", and when i do npm run preview, i don't get an error, BUT, opening up the url gives me Cannot GET ?. its like vite preview cant run my vue app
  • g

    gifted-jackal-27275

    10/12/2022, 3:03 PM
    but, running npx vite by itself works just fine
  • g

    gifted-jackal-27275

    10/12/2022, 3:04 PM
    vite --port 4173 works. vite preview --port 4173 does not. thats the crux i think
  • g

    gifted-jackal-27275

    10/12/2022, 3:05 PM
    boom. i remove preview, and it works
  • b

    bitter-apple-86316

    10/12/2022, 3:15 PM
    Hi team
  • b

    bitter-apple-86316

    10/12/2022, 3:15 PM
    Any work around to intercept same api calling multiple times
  • b

    bitter-apple-86316

    10/12/2022, 3:16 PM
    For example: while navigation to new page single api calling 5 times
  • b

    bitter-apple-86316

    10/12/2022, 3:18 PM
    @gray-kilobyte-89541
  • b

    bitter-apple-86316

    10/12/2022, 3:18 PM
    Please respond
  • a

    adorable-smartphone-87280

    10/12/2022, 3:20 PM
    @bitter-apple-86316 Please do not tag individuals unless you are already engaged in dialogue with them. Especially, do not single-out Gleb for help. This Discord server is a whole community of folks who are willing to help if they are able and Gleb is busy / already does a lot for the testing scene.
  • m

    mysterious-belgium-25713

    10/12/2022, 3:24 PM
    If if your really know that there are 5 of the same calls can't you do. cy.wait(['@route','@route','@route','@route','@route'])
  • m

    mysterious-belgium-25713

    10/12/2022, 3:25 PM
    Or you can maybe use Cypress._times
  • b

    bitter-apple-86316

    10/12/2022, 3:30 PM
    Any example for usage for Cypress._times
  • b

    bitter-apple-86316

    10/12/2022, 3:30 PM
    Please
  • b

    bitter-apple-86316

    10/12/2022, 3:30 PM
    I didn't found any example for intercept using times
  • g

    gray-kilobyte-89541

    10/12/2022, 4:11 PM
    I agree with awesome @adorable-smartphone-87280 that tagging me is unnecessary unless we are already talking about something, but I have covered network testing through hands-on exercises in my course https://cypress.tips/courses/network-testing I can also recommend my plugin https://github.com/bahmutov/cypress-wait-if-happens that can give you the last response (like auto-forward all intercepts)
  • d

    dazzling-pillow-26039

    10/12/2022, 4:28 PM
    What is the use case here. You need to get a certain response or all responses. What you can do is . Use cy.intercept().as(โ€˜aliasโ€™) and later after all api are done. Use cy.get(โ€˜@alias.allโ€™). It gives you an array with all responses.
  • d

    dazzling-pillow-26039

    10/12/2022, 4:29 PM
    If you want to single out a single api response like 2 or 3 use cy.intercept but with req.alias and iterate with a number. This makes a unique intercept alias for each call. Later you can use wait and the number to get the required api call response.
  • w

    witty-army-1426

    10/12/2022, 4:48 PM
    Hello I am trying to make a connection and queries to a database in SQL-Server but it shows that the query has timed out. Could someone help me?๐Ÿค” not a* Cypress: 9.7.0 Node: 16.15.1 Note2* I leave my connection in comments
  • p

    prehistoric-restaurant-72560

    10/12/2022, 7:54 PM
    Super weird, sometimes it works, sometimes it throws cross-origin error :v anyone could check https://www.saucedemo.com/ it's free demo page
  • s

    stale-optician-85950

    10/12/2022, 8:20 PM
    2 or 3 reruns and I get an error. I need to clear the Cypress browser cache and then it passes on next run, then repeats failing etc Looks like the application Service Worker is caching content (as its supposed to) but having a negative effect here. If this is your site you could disable the Service Worker and retest.
  • p

    prehistoric-restaurant-72560

    10/12/2022, 8:33 PM
    Thanks for indepth answer, sadly it's not mine, but at least headless mode runs without throwing any errors.
  • p

    prehistoric-restaurant-72560

    10/12/2022, 8:35 PM
    This page is made for test automation practice, so I don't understand why it's build that way.
  • p

    prehistoric-restaurant-72560

    10/12/2022, 8:36 PM
    Or maybe thats' only an issue for Cypress, cuz originally it was made for selenium https://github.com/PaulVaroutsos/SauceDemo-Automation
  • s

    stale-optician-85950

    10/12/2022, 8:44 PM
    I reckon you could be right there. Have a look at this workaround https://gist.github.com/jamesfulford/26181c332c25d6464c3524510d18e75e This is working for me now:
    Copy code
    describe('Test App', () => {
      beforeEach(() => {
        if (window.navigator && navigator.serviceWorker) {
          navigator.serviceWorker.getRegistrations().then(registrations => {
            registrations.forEach(registration => {
              registration.unregister();
            });
          });
        }
      });
    
      it('Does it error', () => {
        cy.visit('https://www.saucedemo.com');
      });
    });
  • p

    prehistoric-restaurant-72560

    10/12/2022, 8:50 PM
    Working for me as well, thanks for finding this ๐Ÿ™
  • s

    stale-optician-85950

    10/12/2022, 8:51 PM
    Great, it's good for me to know for future reference too.
  • f

    full-state-52918

    10/12/2022, 9:43 PM
    Hello. I am trying to login in our application. But its redirecting to microsoft login. And when i am running the E2E test it is closing the console logs as well. Can anyone please help
  • t

    tall-florist-80510

    10/13/2022, 1:47 AM
    On linux I keep getting a ERR_CONNECTION_CLOSED error when i select the browser to open in e2e test (probably on trying to load the spec files), any idea what might be causing this?
  • t

    tall-florist-80510

    10/13/2022, 1:55 AM
    actually the browser opened by cypress cannot connect to anything at all ๐Ÿค” while theres no prob on my normal browsers
1...173174175...252Latest