https://cypress.io logo
Join Discord
Powered by
# general-chat
  • g

    gorgeous-bird-50464

    08/22/2021, 2:14 AM
    Hello @User , sure thing. I have isolated this issue to be a bug in Safari. It does the correct graphql request to fetch the invitation link, but shows the following screenshot. This error doesn't appear on Chrome. I have raised an issue via the cypress email too.
  • l

    loud-policeman-30507

    08/25/2021, 3:26 PM
    When adding data-cy attributes is the best practice to use camelCase or SnakeCase?
  • f

    fresh-needle-9968

    08/25/2021, 7:14 PM
    so does the
    supportFile
    config option just straight up not work? I've set it to false and it still runs my beforeEach hook
  • f

    fancy-airplane-60156

    08/28/2021, 5:59 AM
    Hi, I'm wondering if there is a known issue with Fixture files. I'm reading two different fixtures files in different tests. However using a same variable name to refer the test data. It seems like it's always referring the data from first fixture file.
  • p

    polite-midnight-10174

    08/30/2021, 1:11 AM
    Hi I was wondering if there were any resources or tutorials for creating plugins?
  • w

    wonderful-match-15836

    08/30/2021, 1:35 AM
    Is something like this what you are looking for? https://filiphric.com/create-a-configuration-plugin-in-cypress
  • p

    polite-midnight-10174

    08/30/2021, 6:34 PM
    @wonderful-match-15836 thanks so much
  • s

    salmon-mechanic-55727

    08/31/2021, 10:48 PM
    Hi everyone! New SDET job posted 🚨 in the #882359988385906708 channel. If you're interested, ping me.
  • h

    handsome-queen-5268

    09/02/2021, 2:58 PM
    Props for the new session functionality πŸ‘πŸΌ One question: Why can’t sessions be cached between spec files in run mode? This can reduce execution time even more
  • u

    user

    09/03/2021, 5:13 PM
    Hi Everyone As a JavaScript & PHP software engineer, I am looking for a full-time job using my skills recently. If you have any jobs, please let me know. I hope your business is doing well Thanks for your time.
  • u

    user

    09/07/2021, 7:46 AM
    I am having issue with cy.session. What I want is to only call my auth provider once and store that in the session so that tests are already logged in when they run. My code works to login without the cy.session but fails when I have it. If I have, the window.sessionStorage is empty and I am redirect to the login page. What am I missing?
    Copy code
    // using node-msal for azure
    
    Cypress.Commands.add('authenticate', (role) => {
        // TODO: ignore role for now
        const usernamePasswordRequest = {
            scopes: ["user.read"],
            username: 'foo@bar.com',
            password: 'f00'
          };
    
        return new Cypress.Promise((resolve, reject) => {
            // Returns a promise
            return pca.acquireTokenByUsernamePassword(usernamePasswordRequest).then(() => {
                // at this point pca has token and we resolve the getKVStore       
                resolve(pca.getTokenCache().getKVStore());
            }).catch(err => {            
                reject(err);
            });
        });
    });
    
    Cypress.Commands.add('login', (role = 'ADMIN') => {
        // If I comment out cy.session, it works
        cy.session(['login', role], () => {
            cy.authenticate(role).then(token => {
    
                const cacheKeys = Object.keys(token);
    
                cy.window().then(win => {
                    for (let key of cacheKeys) {   
                        win(key, JSON.stringify(token[key]));
                    }
                })
            })
        });
      });
    In my beforeEach hook I call cy.login('ADMIN') and then cy.visit('/some') and in my test window.sessionStorage is empty and hence I am redirected to login page.
  • u

    user

    09/08/2021, 4:03 PM
    Good day everyone!
  • u

    user

    09/08/2021, 4:04 PM
    I am experiencing an issue with Cypress and Typescript and I am not seeing where the issue can be:
    Copy code
    Webpack Compilation Error
    ./cypress/helpers/index.ts 35:25
    Module parse failed: Unexpected token (35:25)
    File was processed with these loaders:
     * ../../../../Library/Caches/Cypress/8.3.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/ts-loader/index.js
    You may need an additional loader to handle the result of these loaders.
    |  */
    | function getUniqueDomainName(part) {
    >     const partId = part ?? Date.now().toString();
    |     return faker.internet.domainWord() + '-' + partId + '.' + faker.internet.domainSuffix();
    | }
     @ ./cypress/support/commands.ts 14:0-43 156:21-34 227:19-32
     @ ./cypress/support/index.ts
  • u

    user

    09/08/2021, 4:04 PM
    this worked before I am not sure why its not happy about the
    ??
  • s

    steep-house-78657

    09/08/2021, 5:44 PM
    Check the compilation level if your tsconfig.json file, you may be using an older level of typescript that does not support the ?? operator. Also make sure your typescript compiler is up to date.
  • f

    fast-action-74989

    09/09/2021, 9:31 AM
    Hi @everyone, in my application i have to intercept the error or the warning in the console of chrome, how i do that??
  • f

    fast-action-74989

    09/09/2021, 9:33 AM
    i tried several solutions but i can't figure it out with catching errors and getting them displayed in cypress console
  • i

    important-river-75795

    09/09/2021, 9:33 AM
    @User
    Copy code
    javascript
    Cypress.on("window:before:load", (win) => {
      cy.stub(win.console, "error").callsFake((msg) => {
      // Logging to command log and failing the test case if console error is thrown
          throw new Error(msg);
        }
      });
    });
  • i

    important-river-75795

    09/09/2021, 9:34 AM
    put it in support/index.js
  • f

    fast-action-74989

    09/09/2021, 9:34 AM
    do I also have to insert something directly of the test files?
  • i

    important-river-75795

    09/09/2021, 9:34 AM
    Nope
  • i

    important-river-75795

    09/09/2021, 9:34 AM
    Just this
  • i

    important-river-75795

    09/09/2021, 9:35 AM
    Will fail test cases on console errors
  • i

    important-river-75795

    09/09/2021, 9:35 AM
    And show the error in cypress console
  • f

    fast-action-74989

    09/09/2021, 9:37 AM
    but if there was a material ui warning, directly from the web part, would the error be seen?
  • i

    important-river-75795

    09/09/2021, 10:15 AM
    No , this will stub console errors like these:
  • i

    important-river-75795

    09/09/2021, 10:15 AM
    As you asked πŸ˜„
  • f

    fast-action-74989

    09/09/2021, 10:24 AM
    Thank you very much, but just for information is there also a method to intercept the warnings? Besides, the code above is ready to use without the need for customization because it is a general command to attract errors?
  • i

    important-river-75795

    09/09/2021, 10:31 AM
    No need for customization , to stub warnings just change "error" to "warn"
  • u

    user

    09/09/2021, 12:35 PM
    yeah i got it working; not sure what solved it lol
1...141516...127Latest