You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

testcafe-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-utils

Utils for testcafe.

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

TestCafe Utils

Utils for TestCafe.

Current methods:

async tu.expectEach()

Runs @fn(n) for each n matching @selector.

Runs in series, not parallel.

Example usage:

await expectEach(
  mySelector,
  n => t.expect(mySelector.nth(n).innerText).eql("foo", `Failed on n '${n}'`)
);

Installation

$ npm install testcafe-utils

Usage

const { Selector } = require('testcafe');
const tu = require('testcafe-utils');

const baseURL = 'http://www.imdb.com/title/tt0092400/ratings?ref_=tt_ov_rt';

fixture `IMDB`
  .page `${baseURL}`;

const mySelector = Selector('#main .title-ratings-sub-page table:nth-of-type(2) tr');

test('it', async t => {
  await tu.expectEach(mySelector, n => t.expect(mySelector.nth(n).innerText).match(/all/gi, `Failed on n '${n}'.`));
})

Keywords

testcafe

FAQs

Package last updated on 05 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts