cypress

Cypress can't find Material-UI's textarea

故事扮演 提交于 2020-06-17 00:49:32
问题 I'm building a React app. I use Material-UI version 3.9.3 for my components and Cypress with Cypress Testing Library for my E2E tests. I have a multiline <TextField /> for which I want to write some tests. When you give the multiline prop to TextField it renders for some reason three textarea tags. One of these has a visibility of hidden, but still contains a value. There is also a visible one containing the value, but further down in the tree. <TextField id="outlined-name" label="Name"

Cypress can't find Material-UI's textarea

前提是你 提交于 2020-06-17 00:47:48
问题 I'm building a React app. I use Material-UI version 3.9.3 for my components and Cypress with Cypress Testing Library for my E2E tests. I have a multiline <TextField /> for which I want to write some tests. When you give the multiline prop to TextField it renders for some reason three textarea tags. One of these has a visibility of hidden, but still contains a value. There is also a visible one containing the value, but further down in the tree. <TextField id="outlined-name" label="Name"

how to get value of select<> & option<> tag in cypress

。_饼干妹妹 提交于 2020-06-16 06:39:26
问题 Is there any method or way to get the 'value' of <select><option> tag? I have a scenario where i need to get the value of <select><option> tag, and store it in a variable because the value is dynamic, changing on every execution. I cannot hard code that value like this, because it is changing every time: cy.get(' ').select('b5c12d3-2085-4ed8-bd57-8a93f6ae1e64') so i want to do something like this after getting that value: cy.get(' ').select(value) and by using text value, it is not selecting

How to find element and select by cypress.io with vue.js v-select?

*爱你&永不变心* 提交于 2020-06-14 07:32:09
问题 Sorry,I need help about find element v-select and select option by cypress.io. <v-select label="label" v-model="ccRcode" ref="ccRcode" :items="getData" item-text="descWithCode" item-value="code" value="{ ccRcode }" data-test='test' ></v-select> 回答1: Since you are using Vuetify's select, their documentation should be the first stop. Check the references below. Basically, they add data-cy data attributes to make it easy to target elements. So in your example: <v-select label="label" v-model=

How to find element and select by cypress.io with vue.js v-select?

你。 提交于 2020-06-14 07:29:35
问题 Sorry,I need help about find element v-select and select option by cypress.io. <v-select label="label" v-model="ccRcode" ref="ccRcode" :items="getData" item-text="descWithCode" item-value="code" value="{ ccRcode }" data-test='test' ></v-select> 回答1: Since you are using Vuetify's select, their documentation should be the first stop. Check the references below. Basically, they add data-cy data attributes to make it easy to target elements. So in your example: <v-select label="label" v-model=

How to type using cypress .type() inside the codemirror editor?

邮差的信 提交于 2020-06-14 06:20:08
问题 I am writing some cypress test for the Codemirror Editor. I have use cypress to type in the input field. I am trying to achieve the cy.type() in the CodeMirror Editor. The Data I have in codemirror is inside the span. <pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> < h1 > Welcome to your web project canvas! < /h1></span></pre> The cypress spec code cy.get('pre.CodeMirror-line') .type('Cypress HTML Data') I am not able to type some

How to get data displaying in a table <td> in Cypress.io test?

半世苍凉 提交于 2020-06-14 05:50:36
问题 In a Cypress.io test, while checking for the 'data' displayed in a table after applying the filter, it throws "CypressError: Timed out retrying: Cannot read property 'eq' of undefined". Can someone please advise how to fix the problem in below test? Table HTML image added below. describe('Filter Test', function() { it.only('Check if the records are filtered successfully', function() { cy.visit('http://www.seleniumeasy.com/test/table-search-filter-demo.html') cy.get('button').contains('Filter'

Cypress: run only one test

天涯浪子 提交于 2020-06-09 09:32:23
问题 I want to toggle only running one test, so I don't have to wait for my other tests to see the result of one test. Currently, I comment out my other tests, but this is really annoying. Is there a way to toggle only running one test in Cypress ? 回答1: to run only one file cypress run --spec path/to/file.spec.js or using glob patterns: cypress run --spec 'path/to/files/*.spec.js' Note: you need to wrap your glob patterns in single quotes to avoid shell expansion! to run only one test in a file

Cypress: how to access third party component?

自闭症网瘾萝莉.ら 提交于 2020-05-30 12:57:27
问题 In Cypress I usually access DOM elements with data-test-id attributes. They are hard coded in html. Exemple: <div data-test-id="my-div"></div> then cy.get('[data-test-id=my-div]').click(); But I can't use this method because the app I'm working on uses third party libraries to generate some third party components. A few examples: ngx-datable, full-calendar... Therefore the html is not directly accessible to create data-test-id attributes. I don't want to generate a click based on an x/y

While running the script throws cannot find module 'dotenv'

守給你的承諾、 提交于 2020-05-17 07:28:53
问题 While loading the .env file to pass env values to the getToken.js script in the cypress root folder throws Cannot find module 'dotenv'error. I have installed npm install dotenv . Could someone please advise what I am missing here ? .env file is available in cypress root folder. Environment : Windows 10 > git bash /command prompt const puppeteer = require("puppeteer"); require('dotenv').config({path: '.env'}) const baseURL = process.env.CYPRESS_BASE_URL const testsUser = process.env.CYPRESS