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

    crooked-television-64942

    05/17/2021, 7:24 AM
    I am setting it up inside of my cypress plugin file
  • g

    gray-kilobyte-89541

    05/17/2021, 12:14 PM
    can you open an issue with details? Did you add the plugin to the support file? https://github.com/bahmutov/cypress-grep#install-and-use
  • m

    many-jackal-86011

    05/17/2021, 1:14 PM
    guys, i have tag with message, how can i disable the JS and assert this massage
  • m

    many-jackal-86011

    05/17/2021, 1:16 PM
    i am trying this now
  • m

    many-jackal-86011

    05/17/2021, 1:16 PM
    it("Checking for an informative message when the JavaScript is disabled", () => { cy.visit("/", { script: false }); cy.get("noscript") .should("contain", "We're sorry but todo doesn't work properly without JavaScript enabled. Please enable it to continue." ) });
  • m

    many-jackal-86011

    05/17/2021, 1:18 PM
    or with cy.get("body noscript strong") but the JS is still working and i cant assert the massage
  • c

    crooked-television-64942

    05/17/2021, 2:12 PM
    Hey Gleb! I can for sure, I just followed the documentation. 1 - add
    require('cypress-grep')()
    to support/index.js 2 - add
    require('cypress-grep/src/plugin')(config)
    in module.exports from plugins/index.js 3 - add
    describe('test name', { tags: 'fast' }, () => {
    in a single test as example 4 - run
    npx cypress run --env grepTags=@fast
    for the example the output said: found 93 tests (that's all tests)
  • u

    user

    05/17/2021, 3:50 PM
    does @cypress/snapshot not run in node? it's using a module that requires a lot of process variables
  • g

    gray-kilobyte-89541

    05/17/2021, 8:23 PM
    ohh, I see - the describe blocks still don't work 🙂 because it is ambiguous how to check the individual tests vs suites of tests, see https://github.com/bahmutov/cypress-grep#test-suites You can skip the entire suite, but not
    .only
    it
  • c

    crooked-television-64942

    05/17/2021, 8:28 PM
    Ah, thanks for telling me that! At work we have an internal tool that provides cypress test reports. I wonder if there is a way to get metadata out of the tests to identify whether they are part of certain tag or not
  • b

    billowy-spoon-30011

    05/18/2021, 8:27 AM
    Hi everyone, I'm rather new to Cypress as a young QA testor. I was wondering if there is any way to get real time informations such as today's date or current time for example to use them within my Cypress tests. I search the net for articles but couldn't find anything. Thanks in advance ! 🙂
  • g

    glamorous-byte-70077

    05/18/2021, 3:56 PM
    Hi Everyone, I need some help I am trying to automate a scenario using cypress where I need to signup for new user using my Web-app and verify the user by visiting verification link sent to my email. But the moment i visit the link it changes the url from https://app.example.com/#/activate/hash= to https://app.example.com/document. I am able to fetch the signing link from email using Gmail tester library Cypress, but the moment I visit link it doesn't load anything in the application window neither it changes to url to new one . How to handle such scenario?
  • u

    user

    05/18/2021, 8:30 PM
    @User what's your specific use-case? Can you use a
    Date
    object? e.g.
    const now = new Date()
    ?
  • b

    billowy-spoon-30011

    05/18/2021, 8:34 PM
    @User so basically, I have a time object that gets the date and time of last upload of a dataset and it changes everytime the dataset is uploaded. I'm trying to find a way to verify the date and time is the same as the actual date and time. And I'm kinda new to Cypress, so I'm not sure what your e.g. would permit me to do ?
  • s

    stocky-dream-36427

    05/19/2021, 12:12 AM
    @User I would usually just not test that.
  • s

    stocky-dream-36427

    05/19/2021, 12:12 AM
    Seriously. Unless it's VERY important that that feature works, and that it has broken in the past, I wouldn't test something like that.
  • b

    billowy-spoon-30011

    05/19/2021, 9:18 AM
    Well, to be honest, it's not really that important. It used to not work properly before, that's why I wanted to make sure it's working
  • l

    limited-keyboard-75773

    05/19/2021, 4:08 PM
    I'm trying to run the Cypress's Dashboard on a single specific file from the terminal locally. I ran the command
    npx cypress run --record --key <key-goes-here>
    , however this runs the entire suite. I tried
    npx cypress run --record --key <key-goes-here> --CYPRESS.spec="cypress/integration/path/to/file/*.spec.js"
    but I dont' get it to work. Any ideas what I am doing wrong?
  • l

    limited-keyboard-75773

    05/19/2021, 4:16 PM
    I figured it out. I needed to change
    --CYPRESS.spec="cypress/integration/path/to/file/*.spec.js"
    to
    --spec="cypress/integration/path/to/file/*.spec.js"
  • b

    bumpy-toddler-47155

    05/19/2021, 7:59 PM
    Hi all. I'm having a difficult time debugging node code that exists in the context of a cy.task. Any breakpoint set there is unbound. Any ideas on how to overcome this problem would sure be appreciated. (breakpoint) = a real breakpoint in the code Here is an example of code in /plugins/index.js module.exports = (on, config) => { on('task', { async 'seed'({database}) { (breakpoint) dataset = await dbSeed(); (breakpoint) return dataset; }, ... Here is an example of code that would call it from a spec. describe('Some Suite', () => { before(() => { cy.task('seed', {database}) }) }) So, the problem is that the breakpoints are a hollow circle in VSCode and shown as not bound when executing the code.
  • b

    bulky-sundown-74498

    05/19/2021, 8:46 PM
    This is a hard problem you are having here. Because the chrome/node debugger tools get lost often with async code. Additionally cypress tends to have a hard time with any async/await since it is using Bluebird in a lot of places. Could you try and rewrite the same code using callback functions in promises?
  • b

    bulky-sundown-74498

    05/19/2021, 8:48 PM
    in this case, it would look like
    dbSeed().then(dataset => {do something with your dataset})
  • d

    dazzling-gold-63692

    05/20/2021, 3:30 PM
    Hello, I'm in the process of setting up azure ci pipeline to run cypress tests on azure agent with multiple docker containers parallelly. Are there any working examples of yaml for docker parallell ?
  • b

    bumpy-toddler-47155

    05/20/2021, 7:14 PM
    Hi. I refactored the code similar to what you suggested but no luck. Breakpoints are still unbound. Any other ideas? I think that it may be because the source maps are missing or that VSCode cannot find them but I am not certain how to verify.
  • f

    flat-electrician-52949

    05/20/2021, 7:45 PM
    Hi 👋 Anybody knows how to force an alias to replay instead of keeping the previous element that it got (because it got updated since)
    Copy code
    ts
        cy.get('button').contains('ADD TO CART').click()
    
        cy.get('#state').invoke('text').then(JSON.parse).as('state')
        cy.get('@state').then((cartState) => {
          const expectedCartState: TCartItem[] = [{ ...order, quantity: 1 }]
          expect(cartState).to.deep.eq(expectedCartState)
        })
    
        cy.get('button').contains('ADD TO CART').click()
    
        cy.get('@state').then((cartState) => {
          const expectedCartState: TCartItem[] = [{ ...order, quantity: 2 }]
          expect(cartState).to.deep.eq(expectedCartState)
        })
  • f

    flat-electrician-52949

    05/20/2021, 7:46 PM
    It does not have to be alias - it's just because I think it's a bit too much to do
    cy.get('#state').invoke('text').then(JSON.parse).then(..assertion)
    on every assertion
  • s

    stocky-dream-36427

    05/20/2021, 7:55 PM
    @User you can simply make it a function
  • s

    stocky-dream-36427

    05/20/2021, 7:55 PM
    or add it to Cypress's commands. That's usually what I do to group commands
  • f

    flat-electrician-52949

    05/20/2021, 7:57 PM
    I did try that..
    const assertState = (assertion) => cy.get('#state').invoke('text').then(JSON.parse).then(assertion())
  • f

    flat-electrician-52949

    05/20/2021, 7:58 PM
    It did not work
1...111213...252Latest