Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should set geo location @skip-ci', function (done) {
var getText = function () {
return driver
.elementsByClassName("android.widget.TextView")
.then(function (els) {
return els[1].text();
});
};
var textPopulated = new Asserter(
function () {
return getText().then(function (text) {
if (text === 'GPS Tutorial') {
var err = new Error('retry');
err.retriable = true; // if an asserter throws an error with the `retriable` property set to true, it gets retried
throw err;
} else {
return true;
}
});
}
);
var newLat = "27.17";
var newLong = "78.04";
it('should not display a phishing warning with safariIgnoreFraudWarning', function (done) {
if (isChrome) return _skip(
"Chrome doesn't test safariIgnoreFraudWarning", done);
var titleToBecomeRight = new wd.Asserter(function (driver) {
return driver
.title()
.should.eventually.contain("I am another page title");
});
driver
.get(env.TEST_END_POINT + 'guinea-pig2.html')
.waitFor(titleToBecomeRight, 10000, 500)
.nodeify(done);
});
it('should be able to get performance logs', function (done) {
var isLockedAsserter = function (opts) {
return new Asserter(
function (driver) {
return driver
.isLocked()
.then(function (isLocked) {
isLocked.should.equal(opts.expected);
return isLocked;
})
.catch(function (err) {
err.retriable = err instanceof chai.AssertionError;
throw err;
});
}
);
};
function ChaiAsserter (assertFunc) {
return new Asserter((driver) => assertFunc(driver).catch(tagChaiAssertionError));
}