I am trying to create a test in which I want to compare the width of an element after it has been resized by dragging it. The problem is that the resize library returns the width value as The only thing that changes is this percentage value and this is what I want to compare in the test if it
Tag: testing
How to test code with Jest that uses readonly fields on mocks of libraries (such as ws socket.readyState)?
I want to unit test this JS code with Jest. It’s using the ws websocket library: Socket.js I want to check the error is thrown. For that to happen, I create a mock for the socket and then need to set the readyState of the socket object to CLOSED. The issue is that this is impossible because it’s a readonly
Can’t locate and click on a terms of conditions button
I am new to pupeeteer and first what i am trying to do is loading a page and clicking on a button. However, it can’t locate the element. I assume this is because I need to locate the parent or parent’s parent element. This is the full css selector taken from inspect Here’s my code: It’s a simple accept and
Automated UI test association in Azure DevOps doesn’t work?
I am writing automated UI tests using TestCafe framework. And it needs to associate the test.js file with a TestCase in Azure DevOps to run pipelines and for receiving reports in Test Plan > Progress report. But somehow I can not associate test.js file with a TestCase because the VisualStudio doesn’t sees it Have followed this article https://learn.microsoft.com/en-us/azure/devops/test/associate-automated-test-with-test-case?view=azure-devops But was
Not able to switch to a new tab or window using cypress
I have one scenario where I have to click on one link, that opens a new tab/window, As cypress does not support multiple tabs, I have found below workaround but its not working, It opens the new tab, but not able to switch the new tab and my test is failing with the error : expected redirect to have been
Sudoku puzzle test
Trying to write a script that check if Sudoku puzzle is correctly solved. I tried to check every value using 2 cycles and test method and replace value to “0” if test return true but script does not replace all the values and I don’t understand why. Could you please explain why script replaces some values, but others does not?
Cypress is not running in ci SyntaxError: Unexpected token ‘export’ with cypress-io/github-action@v2 typescript
I have the following plugin file for cypress: frontend/cypress/plugins/index.ts: When I run it on my machine it’s working but when I use cypress-io/github-action@v2 in my github actions I get the following error: This is my .github/workflows/cypress-tests.yml: My frontend/cypress.json config file is empty. This is my frontend/cypress/tsconfig.json in the cypress folder: This frontend/cypress/plugins/tsconfig.jsonis inside the Plugins folder: I have copied this
Testcafe: Click on checkbox inside a virtual element (#document)
So here is the HTML section that describes my reCAPTCHA element and the blue coloured part is the one I’m trying to access: I am aware that for the reCAPTCHA elements there are other workarounds. But I’m curious if it is possible just to click on the checkbox because the test does anyway not appear and it passes automatically when
Module pattern variable returning undefined in test?
I have the following code below which returns certain data depending on NODE_ENV: config.js This works well in my component when I set NODE_ENV. However in my test, I keep getting undefined as a result. config.test.js Again, Config.data works fine in my React component when I start it up, but I guess I need to somehow initialize this for it
Click multiple: true cypress
I have a page where I land that have about 15 icons on it all with the same source. The way im grabbing each element looks like this: The issue that have is that after clicking on an icon I have a model that pops up where I need to click another button before I can continue to the next