Hot answers tagged

5 votes
Accepted

Is there a way to run a subset of tests using Jest?

In true javascript style , the support for this is delayed because of switch to another underlying library , in this case jasmine. There is a -t option here (or --testNamePattern ) which takes a ...
Amias's user avatar
  • 1,202
4 votes

Rerun failed (flaky) tests with Jest

We recently switched from mocha to jest and in the process came across a flake which appears to due to a bug in react. Given the difficulty we had in investigating this issue and that it should be ...
jayrobin's user avatar
  • 141
2 votes

Typescript function not waiting for the waitForExist() and printing the next line

WaitForExit() checks only for the presence of and not the visibility. You could use $(selector).waitForDisplayed instead. And also ensure there is no other element with the same selector.
PDHide's user avatar
  • 11k
1 vote

validated variable is present and datatype assertion using Jest testing

Your admin.js is : const mongoose = require("mongoose"); let Schema = mongoose.Schema; Schema = new Schema({ User: { type: String, unique: true }, Pass: { type: String }, }); var ...
PDHide's user avatar
  • 11k
1 vote

Accessibility testing at the unit level

The best approach I have used is to write unit tests for my accessibility requirements along with all other unit tests. I always insist on more accessibility features than WCAG does, and far more than ...
Jonathan Pool's user avatar
1 vote

How to re-run jest failed test suite

The jest command gives an exit code 1 if a test failed, 0 if all tests succeeded. You could create a bash shell script that looks something like this: #!/bin/bash jest if [ $? -eq 0 ] then echo &...
Niels van Reijmersdal's user avatar
1 vote

Testing nodejs gRPC client functions

There is no sync alternative i could find for that method, so you could validate everything inside the callback itself or wrap it with a promise: let authenticateSync = function (request, meta) {...
PDHide's user avatar
  • 11k
1 vote

How to wait till next page opens after a button click in Jest + TypeScript?

I could found a solution. login_page.ts driver: ThenableWebDriver; findWelcomeMessageField(){ return this.driver.wait(until.elementLocated(By.id('welcome')), 2000); } public async ...
Dona's user avatar
  • 21
1 vote
Accepted

Wait for element change not present (WebDriver/JavaScript/Jest)

I have created my own isNotPresent wait-until method which uses a locator so you can check if an element with a certain class is not present anymore. This loops over the locator either until the ...
Niels van Reijmersdal's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible