Questions tagged [cypress]

1

votes
3

answer
2.5k

Views

Cypress How to store global constants in a file that can be used across all spec files?

I'm looking for a way to store global constants in a file that could be used across all my spec files. Can anyone help?
Ryan Parker
1

votes
2

answer
53

Views

How do I add and use Chrome Extensions with Cypress.io?

I'm currently dealing with a an X-Frame-Options issue being blocked when running my Cypress.io tests. I cannot change the server setup to modify the X-Frame settings. Somebody mentioned to me that I should try a chrome extension called 'Ignore X-Frame headers.' I have the extension installed on...
tonyrocks
1

votes
2

answer
38

Views

Separate locators in .json file - Cypres

Is it possible to separate locators in .json file while working with Cypress? I can't seem to find anything about this online, but it seems like something that should be possible. I separated my locator in a .json file but I have problems with calling them in my tests.
beginner501
1

votes
1

answer
196

Views

How to make Cypress visit work headless on remote server?

I have a url I wish to visit with Cypress. When I run on localhost, headless or with Cypress GUI - it works. When I run on my remote server, the GUI works but the headless does not. This is the test: describe('bootstrap', () => { it('should redirect to login', () => { cy.visit('localhost:8000').the...
oligopol
1

votes
1

answer
258

Views

select Multi-Value Select Boxes using cypress

I could not select Multi-Value Select Boxes (http://select2.github.io/select2/) I try: cy.get('s2id_e9').click() cy.get('ul li:first').contains('California').select() but it does not work. How can I select these options? Hope someone can help?
user2021082
1

votes
0

answer
183

Views

In cypress, how do I clear the appcache before a test run?

Cypress maintains a dedicated user profile, under which there is a persistent appcache (persistent when the cypress browser window is closed). Like chrome, I can clear this manually by going into parameters => clear browsing data. Can I clear it programmatically ?
bbsimonbb
1

votes
1

answer
104

Views

Cypress tests not running

whenever I am trying to run cypress tests I am getting this error. I have cloned spectrum repo and this is my first time I am trying to run cypress tests
Zus C
1

votes
0

answer
212

Views

Require is not defined on electron with cypress

I'm trying to implement cypress in my electron app, but on first line of code which is cy.visit('index.html') it throws require is not defined My index.html contains this inside tag. Webpack preprocessing didn't make sense. window.addEventListener('keydown', e => { if (e.ctrlKey && e.shiftKey && e....
zaebalo
1

votes
0

answer
105

Views

Getting past a SAML login screen with Cypress

I am new to Cypress, and test automation in general, but we have decided to use this tool for some basic e2e testing and post deploy sanity checks, specifically on our webpages with Looker dashboards integrated. Looks like great software but I am having a problem getting through our SAML Authentica...
Adam Lahley
1

votes
2

answer
631

Views

How to read JSON file from cypress project?

I've started with cypress automation and I'm struggling with JSON files. Anyone knows how may I read a JSON file, let's say, located in ../example/vehicle.json? I know cypress is JavaScript, but I'm also having trouble when importing JQuery in cypress project.
Chema Lopez
1

votes
1

answer
610

Views

Difficulties with Cypress scrollTo method

I am having a few issues testing a virtual scroll component with Cypress. I have a test that checks the li elements present in the DOM after scrolling to the bottom of a container. When written like this the test passes: cy.get('.virtual-scroll').scrollTo('bottom') cy.wait(0)...
alTimewax
1

votes
1

answer
156

Views

Is there any way to hide a log in cypress?

I'd like to know if there's a way to not show a log in Cypress, for example. If I make a test to log into any application, when it types the password: cy.get(#id).type(password) and the test is executed, the password value appears in the log. Is there any way of stopping this?
Chema Lopez
1

votes
1

answer
467

Views

How wait for page finish reloading in cypress after click?

I got form and when I trigger click on submit button this cause to refresh current page. After that I would like to do some assertions. How I know that page finished refreshing and I can start to searching an element? cy.get('#formButton').click() // adds new item and refresh page // do assertions...
mardok
1

votes
1

answer
735

Views

No version of Cypress is installed in Ci (TravisCI and CircleCI)

I'm getting this error in CI when updating to Cypress 3.0, saying that Cypress is not installed, but I am running npm install before my cypress run command. The error: No version of Cypress is installed in: /home/ubuntu/.cache/Cypress/3.0.1/Cypress Please reinstall Cypress by running: cypress insta...
bkucera
1

votes
2

answer
283

Views

Cypress browser state maintains log in. How do I stop this from occurring?

I have written a number of cypress e2e tests for an app that requires logging in. I have written successful tests, however the tests have started to fail. The tests expect the app to be logged out when they start otherwise they fail when trying to find the email and password fields. When cypress ope...
radiobrain77
1

votes
0

answer
32

Views

Add delay of Cypress auto-running of test on watch

My dev workflow includes nodemon and webpack, both on watch, which get triggered whenever there is a change in relevant files. I've recently added Cypress to the project, and noticed that it reruns its test too when relevant files are changed. However with my local dev, there is a delay of a few sec...
garajo
1

votes
0

answer
191

Views

How can I run my cypress automated tests using test rail and automatically update the test results in jira(under test rail)?

I am using cypress as front end testing framework, test rail(plugin for jira) as test management tool and jira as project management tool. is there any way I can run my cypress automated tests using test rail and automatically update the test results in jira(under test rail)?
Hari Krishna
1

votes
2

answer
619

Views

Using cypress behind proxy in Jenkins pipeline

I have seen this on github but I was still not able to get cypress to configure/download correctly. In my jenkins pipeline I run npm install but this runs into a timeout because of the proxy. It downloads all other dependencies expect cypress. What I did was download cypress and put the zip file in...
Drew1208
1

votes
2

answer
625

Views

easy way of running different groups of Cypress tests

So I have a project dir under that I have my Cypress dir under that I have two dir's with different tests I run. Right now in my project dir I have a cypress.json that has the setting 'integrationFolder': 'cypress/test_tests',when I issue the command npx cypress run it gets the dir from the integrat...
Bill Flow
1

votes
0

answer
139

Views

Travis CI: start cypress on rails server

I have created a public-repo for testing the private-repo. I have the same config on my private-repo and public-repo : { 'os': 'linux', 'env': 'BUNDLE_GEMS__CONTRIBSYS__COM=1234567890', 'dist': 'trusty', 'cache': { 'bundler': true, yarn: true, 'directories': [ '~/.cache' ] }, 'group': 'stable', 'add...
Joffrey Berrier
1

votes
1

answer
319

Views

cypress - 403 forbidden error when visiting main site

I am trying to cy.visit() my single page application that requires my certificate loaded in the browser to run correctly. When running a test, it fails with a 403 forbidden error. There is a terrible work-around where I open a new tab in the cypress/chrome browser window and go directly to my web ap...
John Castilano
1

votes
0

answer
192

Views

How to get window scroll bar position using Cypress

I use Cypress for functional testing. And want to test or window vertical scrollbar has specific positions. I tried: cy.document().then((doc) => { cy.window().then(win => {...
Edgaras Karka
1

votes
0

answer
64

Views

modified Cypress lib/gui.js. Require modules not found on npm run binary-build

I was slightly modifying the cypress desktop-gui for a project. I modified the /lib/gui.js I added lodash & chokidar by installing them with npm i lodash & npm i chokidar in the desktop-gui folder. I am able to use them and run with npm run build & npm start but when I try to do a npm binary-build i...
Kshitij Joshi
0

votes
0

answer
5

Views

What about is Error: Uncaught ReferenceError: CategoryCmb is not defined

What is that error about? I get it in random places. Is there any option for Cypress.io to ignore it and not to stop the test case?
Łukasz Gordon
1

votes
0

answer
188

Views

Why Cypress not open modal page?

i'm doing some tests and a need to click in a button and is to open a modal page, the click work but the modal page not appear, already used several commands and anything work... My code: describe('Test Modal', () => { it('Modal open', () => { cy.get('span[name=teste]'). contains('Send Email')...
Jean
1

votes
1

answer
235

Views

How to e2e test an Angular app with Firebase authentication and Firestore using cypress

I have an Angular app that uses Firebase Authentication for logging in and then reading and writing data to a Firestore database. I want to do some e2e tests for it. I would rather write the tests with mocked data or a local server. I haven't found any local way of running Firestore so far. I saw t...
lidholm
1

votes
0

answer
66

Views

Cypress with the ContextMenu not work - React Contextify

i'm using a library called React Contexty, and it has a menu that is inside of the Contextify and is called of ContextMenu, when i do request for it to click in the Item of the ContextMenu, it click but the action not happens. Cypress: cy.get('img[data-test=img--menu-candidate]') .click({ force:...
Jean
1

votes
1

answer
65

Views

Cypress - is it possible to store repeated parts of tests in one place?

I have many test cases for the same application views. These views display different data depending on the response from the server. I have 18 test cases in which I check 6 almost identical views. I noticed that a lot of tests are repeating to me. I have a question, can you store any references to a...
inzkornel
1

votes
1

answer
148

Views

Cypress Testing on Android Webview

I have been using Cypress Testing for automate navigation, and I would like to embed it in android to run it from a webview, maybe like: getWebView(myWebView).evaluateJavascript(CypressJS, callback); Any clue or advice is appreciated. Thanks.
ZLNK
1

votes
0

answer
171

Views

Cypress.io and https error

I am using cypress.io for the first time and get an error message in the tool which I think has to do with https and 'site not secure'. Please see attached pictures. I assume this has to do with cypress not running 'outside' the browser as Selenium, but operates directly on the DOM, thus this securi...
Magnus Jensen
0

votes
0

answer
6

Views

Is it possible to use two objects: Force and Multiple in Cypress Test?

I am using cypress test to check all the buttons in the page whether they can be clicked or not. I have used this line of code: cy.get('button').click({ force: true }).should('have.attr', 'href') and gives error CypressError: cy.click() can only be called on a single element. Your subject contained...
researcher
1

votes
1

answer
179

Views

Cypress not waiting for Before block to complete

I am trying to achieve the following functionality Before Block : Call the Cy.visit('/login') and call a Function which will trigger a REST API and process the REST API response and set the local storage. Only after the local storage is set click on 'My Account' Link Here is the source Code I am t...
Venkata
1

votes
1

answer
607

Views

Bypass UI Login using Cypress

I am having problem bypassing UI login. My web application doesn't use API to authenticate users. There are no endpoints like /login. index.php will just open the login page and submit the form to login. The application authenticate the user by auth($_REQUEST['username'], $_REQUEST['password_tx']);...
Jake He
1

votes
1

answer
92

Views

Cypress: cannot select option from an ajax call

Sorry for asking this. I'm quite new in using cypress. I have two selects. #firstSelect and #secondSelect. #firstSelect options would be filled up using ajax upon document.ready #secondSelect options would be filled up after firstSelect got a value. At first I tried using static values like cy...
Josh
1

votes
2

answer
103

Views

What is the best practice of pass states between tests in Cypress

I want to pass/share data between each test. What is the best way to implement it in Cypress? For example: it('test 1'), () => { cy.wrap('one').as('a') const state1 = 'stat1' }) it('test 2'), () => { cy.wrap('two').as('b') }) it('test 2'), () => { //I want to access this.a and this.b //Also I want t...
Jake He
1

votes
0

answer
168

Views

Cypress and contexts - wait for context

I have diveded my cypress script into two separate contexts like this: /// context('Navigation', () => { beforeEach(() => { cy.visit('xxx') cy.get('.form-group:first-child input:nth-child(1)') .each(($el, index, $list) => { switch (index) { case 0: cy.wrap($el).type('xxx') break; case 1: cy.wrap($e...
Magnus Jensen
1

votes
0

answer
293

Views

Can´t open an internal page in Cypress Chrome

We have an cypress issue that is similar to the issue described in 'https://github.com/cypress-io/cypress/issues/850'. The reason for why I am creating a new post is that I have done some changes in the environment which makes this work but only after the first fail and then manually click on the fa...
ASE
1

votes
0

answer
63

Views

Cypress- Count every instance of a button on the page

I have 15 buttons on a page. Atm, Im doing cy.get('[buttonId='SOME VALUE BETWEEN 1 and 15']').click(). This works for each button click. However, I don't want to hardcode the # of buttons on the page. Is there any way for Cypress to get the count of the # of buttons on the page, then I can iterate...
R.S Mohan Aravind
1

votes
0

answer
87

Views

Re-run Cypress tests in GUI when webpack-dev-server causes page reload

I'm using webpack-dev-server and the Cypress GUI for a development workflow and I'd like for Cypress to automatically re-run/restart tests when the page reloads as triggered by WDS auto-reload. What happens now is that I see WDS cause the page to reload, but the Cypress session just stays where it l...
Derek Harmel
1

votes
0

answer
63

Views

e2e testing a file download and verify (assertion) the content

I need to test a file download and assert that contents of the file are valid. Tests are written in plain JS and testing tool doesn't matter. I have tried puppeteer, testcafe, cypress and even good old selenium with phantomJS but I am unable to get it done. I am sure this is a very common use-case...
Waku-2

View additional questions