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

    calm-doctor-58650

    11/24/2021, 3:51 PM
    Hey Anca, have you tried our Okta Authentication guide in the docs: https://docs.cypress.io/guides/testing-strategies/okta-authentication
  • c

    calm-doctor-58650

    11/24/2021, 3:54 PM
    Is there any consistency with when this occurs? Similar areas of the app/tests/functionality/etc.? Is there anything in your application that could be saving and re-setting the cookies based on application behavior? Without an example to go on it's difficult to say but that might help you get started in troubleshooting. Searching for similar GitHub issues may also help, in case others have experienced that behavior and posted their solutions.
  • s

    salmon-oxygen-44652

    11/24/2021, 6:03 PM
    Hello everyone, I try to test a vue3 component made with the composition api, it uses a data that is displayed in the template, can I set the data of my component when mounting in my test ?
  • s

    salmon-oxygen-44652

    11/24/2021, 6:03 PM
    I tried this but no luck
  • s

    salmon-oxygen-44652

    11/24/2021, 6:05 PM
    should I do this in the first place ?
  • s

    salmon-oxygen-44652

    11/24/2021, 9:03 PM
    is there any way to check if an tag isn't clickable ?
  • u

    user

    11/24/2021, 10:18 PM
    I believe there is a
    should
    assertion for
    ”not.be.clickable”
  • s

    salmon-oxygen-44652

    11/24/2021, 10:26 PM
    @User unfortunately not :/
  • s

    salmon-oxygen-44652

    11/24/2021, 10:36 PM
    how can we deal with v-model ?
  • s

    salmon-oxygen-44652

    11/24/2021, 11:22 PM
    I cant find a way to react to events in cypress
  • n

    numerous-oxygen-9655

    11/26/2021, 12:24 PM
    Hi, I’m trying to skip a Vimeo video using their iframe
    postMessage
    API. However, it appears messages I send are never received.
    Copy code
    ts
    cy.window().then(
      (window) =>
        new Cypress.Promise((resolve) => {
          const onMessage = (event) => {
          const { data } = event;
            console.log(data);
            if (data.method === 'getDuration') {
              resolve(data.value);
            }
          };
          window.addEventListener('message', onMessage);
          const iframe = window.document
            .querySelector('[data-block="@appsemble/video"] > div')
            .shadowRoot.querySelector('iframe');
          iframe.contentWindow.postMessage({ method: 'getCurrentTime' }, '*');
          iframe.contentWindow.postMessage({ method: 'setCurrentTime', value: 60 }, '*');
        }),
    );
    If I manually call
    postMessage()
    I can see Vimeo sends a response in the
    onMessage
    handler. Also the
    setCurrentTime
    method sets the current time. However, if
    postMessage()
    is called from Cypress, vimeo doesn’t respond.
  • r

    rich-businessperson-57314

    11/28/2021, 4:03 PM
    is not working with any code that i found it on google. 😦
  • r

    rich-businessperson-57314

    11/28/2021, 4:11 PM
    > // Okta Login > Cypress.Commands.add('loginByOktaApi2', (username, password) => { > const optionsSessionToken = { > method: 'POST', > url: 'https://xxxxxxxxx/api/v1/authn', > body: { > options: { > "multiOptionalFactorEnroll": true, > "warnBeforePasswordExpired": true > }, > username, > password > } > } > cy.request(optionsSessionToken).then(response => { > const sessionToken = response.body.sessionToken; > cy.request({ > method: 'GET', > url: 'https://xxxxxxxxxxxx/oauth2/v1/authorize?', > form: true, > followRedirect: false, > qs: { > client_id: ‘x’xxxxxxxxxxxxxxx, > redirect_uri: 'https://xxxxxxxxxxxxx/enduser/callback', > response_mode: 'fragment', > code_challenge: ‘x’xxxxxxxxxxxxxxxx, > code_challenge_method: 'S256', > response_type: 'code', > state: 'test', > scope: 'openid', > sessionToken: sessionToken > } > }).then(response => { > cy.log(JSON.stringify(response)) > const urlWithToken = response.headers.location.toString(); > cy.log(urlWithToken) > cy.wrap(urlWithToken).as('oktalogin') > }); > }); > })
  • r

    rich-businessperson-57314

    11/28/2021, 4:12 PM
    //Okta applied describe('My Project', ()=> { beforeEach(() => { cy.clearCookies(); cy.clearLocalStorage() cy.loginByOktaApi2( Cypress.env('auth_username'), Cypress.env('auth_password') ) }) it('navigate to enviroment, () => { cy.get('@oktalogin').then((url) => { cy.visit(url).wait(3000) cy.contains('button').should('exist').then(function(ln) { const urlRed = ln.prop('href') cy.window().then(win => { cy.stub(win, 'open').callsFake(() => { return win.open(urlRed, '_self') }) }) }) }) }) })
  • r

    rich-businessperson-57314

    11/28/2021, 4:14 PM
    with the code above I can get to the okta user home page, but when I click on my app it's opening in a new window 😦 and i want i the same window ... with the code above i can't do anything 😦
  • r

    rich-businessperson-57314

    11/28/2021, 4:14 PM
    if i use href my okta login is not keep it
  • r

    rich-businessperson-57314

    11/28/2021, 4:16 PM
    how can i keep the cookies of okta and open the url in the same window, not on new tab
  • d

    dazzling-angle-28206

    11/28/2021, 6:50 PM
    Have you tried
    Copy code
    Cypress.Cookies.defaults({
            preserve: ((cookie) => true)
        })
  • d

    dazzling-angle-28206

    11/28/2021, 6:50 PM
    I'm not sure if that is the recommended way to do this but you may use that as a starting point if it works
  • c

    creamy-breakfast-78650

    11/29/2021, 9:57 AM
    Hello, has anyone a good book or guide he would recommend when someone starts with e2e testing & cypress
  • f

    fancy-airplane-60156

    11/29/2021, 11:40 AM
    Hi, I'm using cypress-visual-regression plugin to run Visual regression tests. Even though I run below command to take baseline snapshot image, my screenshots gets saved in actual folder instead of base. Any help is much appreciated.
    c
    • 2
    • 4
  • f

    fancy-airplane-60156

    11/29/2021, 11:40 AM
    cypress_version=stage npx cypress run --spec "cypress/integration/VisualRegression/*" -- env type=base -- config screenshotsFolder=cypress/snapshots/base
  • c

    calm-doctor-58650

    11/29/2021, 7:56 PM
    Hi Anca, I'd recommend checking out the example in the guide I posted. It looks like in your code you are still attempting to visit Okta via the UI. However, in the example in our docs, we actually recommend bypassing the Okta UI entirely. Instead, you'll use a cy.request() to get the user item, including token, and then set the token in local storage.
  • c

    calm-doctor-58650

    11/29/2021, 8:01 PM
    Hi Limuz! Our documentation is a great place to start, and if you're looking for courses, Test Automation University has free beginner and advanced Cypress courses. You can also check out our Real World App for examples and best practices with Cypress. https://docs.cypress.io/guides/overview/why-cypress https://testautomationu.applitools.com/ https://github.com/cypress-io/cypress-realworld-app
  • c

    creamy-breakfast-78650

    11/29/2021, 8:03 PM
    @User thank you some realword-app i tryed will into TAU to thanks
  • c

    calm-doctor-58650

    11/29/2021, 8:08 PM
    cypress-visual-regression
  • m

    millions-judge-45394

    11/30/2021, 4:59 AM
    Hello Everyone, I am new to cypress and percy. Just exploring and trying to implement visual testing testing using cypress and percy. However while executing I am getting the below error. It ran successfully, but not able to take DOM snapshot.
  • m

    millions-judge-45394

    11/30/2021, 4:59 AM
    [percy:cypress] Could not take DOM snapshot "Customer Central- Dashboard Page" (58964ms) [percy:cypress] Error: Missing required URL for snapshot at request (https://abc.com/__cypress/tests?p=cypress\support\index.js:769:28) at async Object.postSnapshot (https://abc.com/__cypress/tests?p=cypress\support\index.js:880:6) (3ms)
  • m

    millions-judge-45394

    11/30/2021, 5:00 AM
    Any help on the above is much appreciated
  • p

    powerful-crayon-15587

    11/30/2021, 1:41 PM
    Hello everyone I just started to learn cypress and recently I started to get a problem on a website I need to do a test on. After I visit the website I always get this error in the picture and I don't know how to fix it. I wasn't able to find something similar anywhere and the only command I typed in was the visit and ofc the functions. (The instructions in the picture didn't change anything)
1...383940...252Latest