Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@rpii/wdio-data-driven
Advanced tools
Readme
Updated for module compatibility with webdriver 8
Provides tool for emulating data driven tests in webdriverio. Updated for compatibility with webdriverio version 6. Now hides passwords.
Completely taken from the nightwatch version: https://github.com/rpii/nightwatch-data-driven and adapted for wdio. Supports iteration of data from spreadsheet pages. There are two modes of operation, straight iteration or usage of callbacks functions for asserting on varying conditions. Works ONLY with async mode in version 7 and up . Allows the usage of spreadsheets pages as datasets for test iteration.
Pass an array to forCases, see example belopw
Update to async mode in webdriverio
add this chaining
npm i @rpii/wdio-data-driven --save
Create DataDrivenTest instance passing a function representing the body of the test (the Arrange
TestFn
Assert_ functions).
Call forCases method with object containing names and data for test cases. Use disabled parameter to deactivate test case(see example).
Pass in a spreadsheet with the credentials to be tested.
import DataDrivenTest from '@rpii/wdio-data-driven';
import {authConfig} from '../configs/auth';
suite('login test suite', function () {
test('user login missing password', function () {
new DataDrivenTest(browser, function(dataSet, name) {
LoginPage.loginFn(dataSet,LoginPage.assertInvalidCredentials.bind(LoginPage));
})
.forCasesInSpreadsheet('./test/data/credentials.xlsx', 'bad-credentials');
});
};
import DataDrivenTest from '@rpii/wdio-data-driven';
import {mother} from '../mother';
// . Create "test blank"
let submitLoginForm = new DataDrivenTest()
.testFn(function(dt) {
this.browser.page.login().section.loginForm.fillAndSubmit(dt.email, dt.pass)
})
.withArrange(function(cb) {
browser.logout(cb)
});
suite('invalid email test suite', function () {
test('Login is invalid email: show error': function () {
// . Use "test blank" with specific assertion and test cases
submitLoginForm
.withAssert((dt, nm) => browser.page.login().assertNoProgress(nm))
.forCases({
"1. ": {email: "a", pass: mother.Valid.PASS},
"2. ": {email: "@b", pass: mother.Valid.PASS},
"3. ": {email: "@b.", pass: mother.Valid.PASS},
"4. ": {email: "@b.c", pass: mother.Valid.PASS},
"5. ": {email: "a@b", pass: mother.Valid.PASS},
"6. ": {email: "a@b.", pass: mother.Valid.PASS},
"7. ": {email: "a@b.c", pass: mother.Valid.PASS},
"8. ": {email: "й@ц.ук", pass: mother.Valid.PASS},
});
});
test('Login is valid email: show progress': function () {
// . Use "test blank" with specific assertion and test cases
submitLoginForm
.withAssert((dt, nm) => browser.page.login().assertProgressDisplayed(nm))
.forCases({
"1. ": {email: "a@b.cd"},
"2. ": {email: "1#$%&'*+/=?^-_`{|}~.a@b.cd"},
"3. ": {email: "a@1-b.cd"},
"4. ": {email: "a@b.12"}
});
});
let arrayTest = [
{ name: "1. ", email: "a@b.cd"},
{ name: "2. ", email: "1#$%&'*+/=?^-_`{|}~.a@b.cd"},
{ name: "3. ", email: "a@1-b.cd"},
{ name: "4. ", email: "a@b.12"}
];
});
test('Login is valid email: show progress': function () {
// . Use "test blank" with specific assertion and test cases
submitLoginForm
.withAssert((dt, nm) => browser.page.login().assertProgressDisplayed(nm))
.forCases(arrayTest);
}
FAQs
Provides tool for running data driven tests in webdriverio.
The npm package @rpii/wdio-data-driven receives a total of 15 weekly downloads. As such, @rpii/wdio-data-driven popularity was classified as not popular.
We found that @rpii/wdio-data-driven demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.