cypress

Accessing network responses in Cypress.io

早过忘川 提交于 2020-03-23 12:21:09
问题 I'm working on testing an OpenID Connect service, using Code and Implicit Flow. I would really like to be able to access the messages I get back from the service, especially the 303 See Other message which has the ID Token. If someone can advise on how to get to response messages I would really appreciate it. Since the services exposes a HTML login page what happens is a cy.get("#loginButton").click() so I don't send a cy.request() and that is because I want to test login using the front-end.

Flash存储器现货行情

岁酱吖の 提交于 2020-03-11 14:32:09
据多名从业者反映,目前存储芯片交货的几乎都是年前的订单,因为疫情影响没有新的订单需求。对于行业内的行情,业者多持看好的态度,相信今年的订单需求会随着疫情的好转慢慢转为强劲,下半年也可能出现供不应求的情况。 NAND Flash:因为SSD的缺货,导致大容量Nand Flash近期询盘增多,但是因为大容量Nand flash 单价高,流通度低,代理商很少会备货库存持续下降,供给也较为保守。 受5G需求刺激,加上各类产品搭载SSD比重与容量显著提升,终端都积极备货,均成为刺激Nand Flash需求增温的动能,今年 NAND 价格走势预计稳健向上,下半年也可能面临供给短缺情况。 由于缺货涨价的现象可能还会持续一段时间,建议有SSD相关需求的业者可以考虑适当备货。 Nor Flash:最近一段时间,Nor Flash各品牌在春节后均呈上涨趋势。 Micron方面,近期价格相对比较稳定,但相较其他品牌,价格还是比较高。 而 Cypress ,在春节过后Nor Flash呈上涨趋势,高容量型号涨幅明显。 Winbond从2019年Q4季度末开始,16M到如今的256M持续涨价,并且都是分货状态,价格变动较大,需要在到货之后确认分货价格。并且由于5G等项目,将进一步影响晶圆供应以及产能,整体来说后期趋势看涨。 Cypress Nor Flash 2Gb型号表 Density Part

How to prevent cy.get from “snapshotting” a list before it's sorted

瘦欲@ 提交于 2020-03-05 00:28:39
问题 Not the best title, but here's my challenge. I have a list on my page that can be sorted, and I want a Cypress test that checks that it works as expected. So imagine this test: /* 1 */ cy.get('.list-item').eq(0).should('have.text', 'A'); /* 2 */ cy.get('.list-item').eq(-1).should('have.text', 'Z'); // Code that triggers sorting to change from asc to desc /* 3 */ cy.get('.list-item').eq(0).should('have.text', 'Z'); /* 4 */ cy.get('.list-item').eq(-1).should('have.text', 'A'); Looks simple, but

While running cypress via docker command, cypress type() getting undefined

China☆狼群 提交于 2020-03-04 18:29:50
问题 While running the cypress test using below docker command from windows 10 command prompt, the below error occurs. docker run -it -v %cd%:/e2e -w /e2e cypress/included:3.4.0 But while running the cypress test by npm run cy:test-uattest script from windows command prompt all the test run successfully. Any idea why the cy.type() command becomes 'undefined' while running the docker command. cy.get('input[name="firstInput"]').type(Cypress.env('firstNumber')); Below is my Cypress.env.json file {

Using for loop and if else in cypress

好久不见. 提交于 2020-03-03 09:04:56
问题 I am in a situation where I need to use for loop and If else block in cypress Scenario : Once I login to an application, I need to read an element's text which is rounded in the below screenshot. This element will appear within 20-90 seconds after I log in, when I refreshed the screen. so I need to write something like this, wait for element, if it appears reads the text and returns the value, if not wait for 10 seconds reload the page and do the process again. function waitAndreload() { for

cypress - do action until element shows on screen

橙三吉。 提交于 2020-02-29 06:46:08
问题 I know that Cypress is not big on conditional testing, but coming from a selenium webdriver background, I'm very used to using this kind of logic in my tests. I am testing a KaiOS app that instead of scrolling, uses page flipping similar to a kindle device to make it easier for the user to read. Currently, since KaiOS is based on Firefox OS, the only way to use the app on a computer in a similar way to the device is to use firefox. The problem is that the page flipping when running the tests

Cypress - run test in iframe

我只是一个虾纸丫 提交于 2020-02-25 08:23:29
问题 I'm trying to find elements in iframe but it doesn't work. Is there anyone who have some system to run tests with Cypress in iframe? Some way to get in iframe and work in there. 回答1: It's a known issue mentioned here. You can create your own custom cypress command which mocks the iframe feature. Add following function to your cypress/support/commands.js Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe, selector) => { Cypress.log({ name: 'iframe', consoleProps() { return {

Cypress - run test in iframe

北城以北 提交于 2020-02-25 08:23:28
问题 I'm trying to find elements in iframe but it doesn't work. Is there anyone who have some system to run tests with Cypress in iframe? Some way to get in iframe and work in there. 回答1: It's a known issue mentioned here. You can create your own custom cypress command which mocks the iframe feature. Add following function to your cypress/support/commands.js Cypress.Commands.add('iframe', { prevSubject: 'element' }, ($iframe, selector) => { Cypress.log({ name: 'iframe', consoleProps() { return {

Set local storage in Cypress

為{幸葍}努か 提交于 2020-02-05 06:47:10
问题 For one of our applications, I need to set local storage in order to bypass the login page process. I have the following function that will return the accessToken that I need to set. This function works when running in node. async function getAccessToken(email, pwd) { const form = {email: email, password: pwd}; let config = { headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', } }; const accessToken = await axios.post(`${process.env.API_URL}/loginWithToken`, qs

Gather results from multiple cypress promisses

依然范特西╮ 提交于 2020-02-04 01:21:23
问题 Is it possible in Cypress.io to gather results of multiple assertions inside .then construction so that results can be used outside .then ? Based on below example - if I have some pages that I would like to smoke-test (to check eg. if code is different than 404) how to gather information about them? How to verify results all together in one smoke test? Please look at this simple piece of code that shows the problem: describe('Smoke tests for some pages', () => { it('should be able to view