Comments (2)
Hardy v1.1.0
from hardy.
I wrote a couple of custom step definitions to help with this:
Contains
this.Then(/^"([^"]*)" should have "([^"]*)" that contains "([^"]*)"$/, function(selector, property, value, callback) {
var elementSelector = require( process.env['BINARYPATH'] + 'features/support/selectors.js')(selector);
var message = '"' + property + '" should contain ' + '"' + value + '"';
this.getCssProperty(elementSelector, property, function(err, actualValue) {
if (err) {
if (typeof err === "object") {
err = JSON.stringify(err);
}
return callback.fail(err);
}
var substringLocation = actualValue.indexOf(value);
try {
assert.notEqual(-1, substringLocation, message);
} catch (e) {
return callback.fail(e.message);
}
callback();
});
});
Starts with
this.Then(/^"([^"]*)" should have "([^"]*)" that starts with "([^"]*)"$/, function(selector, property, value, callback) {
var elementSelector = require( process.env['BINARYPATH'] + 'features/support/selectors.js')(selector);
var message = '"' + property + '" should start with ' + '"' + value + '"';
this.getCssProperty(elementSelector, property, function(err, actualValue) {
if (err) {
if (typeof err === "object") {
err = JSON.stringify(err);
}
return callback.fail(err);
}
var substringLocation = actualValue.indexOf(value);
try {
assert.equal(0, substringLocation, message);
} catch (e) {
return callback.fail(e.message);
}
callback();
});
});
from hardy.
Related Issues (20)
- Support for other image croppers/comparisons? HOT 9
- Visual diffs and reporters in Hardy HOT 3
- Running Hardy from a node_modules folder goes into infinite loop HOT 1
- Logging improvements
- Two versions of selenium included HOT 1
- Pull in latest Selenium HOT 1
- Only first selector in the page is tested HOT 1
- getting started HOT 11
- Is it possible to have a grunt module ?
- selenium start user feedback
- Command-line interface HOT 2
- Travis error: throw er; // Unhandled 'error' event HOT 1
- Logfile output ? HOT 1
- Ability to test a local html file?
- Windows 7 issues HOT 1
- Process for cross-platform screenshots HOT 3
- Unknown system error when running first test HOT 5
- hardy can't find page elements HOT 3
- Using :contains() pseudo class selector HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hardy.