cypress

Cypress w/graphql - having issues getting AUTH with testing via UI. Better way to stub mutation?

江枫思渺然 提交于 2019-12-02 04:46:38
问题 So, if I am testing pages in a vacuum without much interaction with the backend, it works great. I am having issues with actually interacting with my UI if it hits any type of service. Basically, nothing is Auth'd. I try programmatically setCookie, no dice. I try to read the cookie, nope. Btw, my whole site requires a login. cy.setCookie('sess', ';askjdfa;skdjfa;skdjfa;skdjfa;skfjd');<-- does not work cy.getCookie('sess').should('exist') <-- does not work I am having an issue on really the

Grab a string to use in a .visit() call in cypress

旧街凉风 提交于 2019-12-02 02:59:48
问题 I have a dom element that contains the string or a url that I would like to visit. I have labelled the dom element with a data attribute for easy reference. Above where it says 'Create Topic' in bold is the string and in the console, you can see it has a data-test='topicUrl attribute. I want to capture this string value so that I can visit the url a a later point. I followed the docs on Variables and Aliases and tried cy.get('[data-test="topicUrl"]').invoke('text').as('Url') so that I could

cypress

匆匆过客 提交于 2019-12-02 00:55:52
https://community.cypress.com/docs/DOC-14090 usb3.0 only支持 来源: https://www.cnblogs.com/hshy/p/11723705.html

Cypress w/graphql - having issues getting AUTH with testing via UI. Better way to stub mutation?

跟風遠走 提交于 2019-12-02 00:40:09
So, if I am testing pages in a vacuum without much interaction with the backend, it works great. I am having issues with actually interacting with my UI if it hits any type of service. Basically, nothing is Auth'd. I try programmatically setCookie, no dice. I try to read the cookie, nope. Btw, my whole site requires a login. cy.setCookie('sess', ';askjdfa;skdjfa;skdjfa;skdjfa;skfjd');<-- does not work cy.getCookie('sess').should('exist') <-- does not work I am having an issue on really the best way to "test" this. For example, I have an account section that a user can "update" their personals.

cypress

百般思念 提交于 2019-12-01 20:08:07
https://baike.baidu.com/item/CYPRESS/10584395?fr=aladdin 来源: https://www.cnblogs.com/hshy/p/11715965.html

How to call circleCI environment variable in an Angular 2+ project?

浪子不回头ぞ 提交于 2019-12-01 11:30:35
问题 I have an angular project that has an api-keys.ts file that looks like this: export var masterFirebaseConfig = {apiKey: $fireBaseApiKey, authDomain: 'dataJitsu.firebaseapp.com',databaseURL: 'https://datajitsu.firebaseio.com',storageBucket: '',messagingSenderId: '495992924984'}; I think the $fireBaseApiKey is stored as an environment variable in my project on circleCI, as you can see in the picture here: However, I still get the following error when I run my configuration on circleCI: ERROR in

Angular Cypress.io test with Google Login popup window

不打扰是莪最后的温柔 提交于 2019-12-01 05:32:55
问题 Is it possible to login to a Google account with Cypress.io using the Google authentication pop-up window? I can get the window to open, but then Cypress can't detect the ID for the email input field. The error is: "CypressError: Timed out retrying: Expected to find element: '#identifierId', but never found it." it('Login', function() { cy.visit('home') cy.get('#signin-button').click() cy.get('#google-login-button').click() // cy.wait(1500) // wait doesn't help cy.get('#identifierId') .type(

In cypress, how do I wait for a page to load?

一世执手 提交于 2019-12-01 04:04:30
Don't tell anyone, but our app is not yet single-page. I can wait on a given XHR request by giving the route an alias, but how do I wait until some navigation completes and the browser is safely on a new page? Igor Shubovych You can add some assert inside: cy.click('#someButtonToNavigateOnNewPage'); cy.location('pathname', {timeout: 60000}) .should('include', '/newPage'); cy.click('#YouAreOnNewPage'); You can change default timeout - by default it's 4000 ms (4 secs) - to ensure that user navigated the page. I've put a big number here - 60,000 ms - because I'm sure that 99% of users will leave

select dropdownlist item using cypress

佐手、 提交于 2019-12-01 02:45:22
问题 I need to test a dropdown on angularjs application using cypress. I would need to click on a dropdown and select or click an item from the dropdownlist. I tried as below which worked for one instance but not other time because the id number in the second get() method keeps changing as its dynamically generated. This is not a standard select with options as in html. 1) Is there anyway I can set an unique attribute on each option and just select the required one or can I just select based on

How to select nth item inside select element in cypress

孤街浪徒 提交于 2019-11-30 11:04:40
say I have the HTML: <select name="subject" data-testid="contact-us-subject-field"> <option value="What is this regarding?">What is this regarding?</option> <option value="Partnerships">Partnerships</option> <option value="Careers">Careers</option> <option value="Press">Press</option> <option value="Other">Other</option> </select> Selecting an option with a known value, such as 'Careers' is as easy as: cy.get('[data-testid="contact-us-subject-field"]').select('Careers'); How do I select the nth option in this field, regardless of its value? By using eq cy.get('tbody>tr').eq(0) // Yield first