Skip to main content

All Questions

3 votes
1 answer
848 views

Cypress intercept for dynamic pathParam in api and * functionality

I have few API's that i need to intercept. 'randomApi/import/entity' 'randomApi/import/entity/lead1/tabs' 'randomApi/import/entity/lead2/tabs' lead1 and lead2 are values that are coming in the 1st ...
Achal Utkarsh's user avatar
0 votes
1 answer
181 views

Testing async functions that fetch data using jquery with Jest

I am trying to test an async function that fetches data from a json file and stores it in a variable The function I am trying to test (present in registration.js): async function readJSONFile(url) { ...
prav's user avatar
  • 33
1 vote
1 answer
861 views

How do I display number of selected items in checkbox?

How do I display the number of selected items? I've tried different ways to count the checkbox but it did not count the items when I click "select all". I want to show the number of these ...
Noso Sanas's user avatar
5 votes
3 answers
5k views

Cypress custom find command is not chainable

I want to create a custom Cypress find command like so to utilize a data-test attribute. cypress/support/index.ts declare global { namespace Cypress { interface Chainable { /** * ...
Théo Lavaux's user avatar
  • 1,454
0 votes
0 answers
79 views

Jest - Mocking JQuery plugin's functions

I have to test (using Jest) some JQuery plugins. I'm having problems with this one, because I want to check if some function is called and it keeps telling me that it hasn't. I simplified the plugin's ...
Ricardo Cardoso's user avatar
0 votes
2 answers
3k views

Exit from while loop with if/else in Cypress

I am writing a test case which requires me to reload the page N number of times, and compare its title for a value, if that value does not exists then break the while loop without rising error. Below ...
philein-sophos's user avatar
0 votes
1 answer
159 views

Looking for a child element within ElementHandle with waitFor

I have a specific listing that contains the lazy-loading calendar for each record. I catch them by docsPanels = await page. $$ ('[data-id = "result-item"]'); then I need to go to every ...
Slawko's user avatar
  • 1
1 vote
3 answers
3k views

How to use JavaScript to find all elements which have event listeners?

<div id="test1" onlick="testFunction()" role="button" tabindex="0">A custom button</div> <div id="test2" role="button" ...
aaronbnb's user avatar
0 votes
0 answers
165 views

Is it possible to test a .each(function()) statement?

I am attempting to test a javascript function. I am using jquery, sinon and running jsTestDriver.jstd in PhpStorm. I have two different scenarios where I need to test .each(function()). Scenario 1: ...
Sharon's user avatar
  • 138
4 votes
1 answer
8k views

Jasmine Testing - How to test for a css class being applied?

I am currently creating my first JS project and am trying Jasmine unit testing for the first time. In my code, I want to test the function in one of my classes which applies a css class to a button ...
SamJP's user avatar
  • 43
5 votes
1 answer
6k views

Cypress fixtures usage in TypeScript

I have used Cypress with Javascript specs and recently switched to Typescript. While using Fixtures, I had the below approach working in Javascript; but, with Typescript I face some difficulty. ...
Kondasamy Jayaraman's user avatar
0 votes
1 answer
113 views

Testing working Angular component - TypeError: $(...).somename is not a function

I have problem while testing my component - spec.ts is autogenerated file that I'm using to test. What is weird is that my components works fine - I was testing this for a while, but every time I try ...
D.Zet's user avatar
  • 779
0 votes
0 answers
76 views

Jasmine/Javascript - why is a DOM element only accessible by reference from within an async then()?

After a loooot of testing... I stumbled upon some interesting behavior that I don't understand. Code: function someFunction() { ... // whatever this is stubbed } // below is called ("mounted") by ...
james's user avatar
  • 4,047
1 vote
1 answer
877 views

Nightwatch - How to determine if scroll top button has worked?

Anyone know how to check if a scroll top button has worked well and the current position of the scroll is 0 to top? I have tried a lot of nightwatch functions and none of them has worked well. I ...
Paco Gómez Capón's user avatar
1 vote
2 answers
1k views

Clicking on choosen coordinates in WebGL (canvas)

I am working with an app which embeds a WebGL Player. <body> <div class="application_layout"> <header class="header clearfix"> <nav class="header__left"> ...
fabdurso's user avatar
  • 2,454

15 30 50 per page
1
2 3 4 5
8