Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expect-protractor

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-protractor - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

11

lib/index.d.ts
declare namespace jasmine {
interface Matchers<T> {
toBeDisplayed(): Promise<void>;
}
}
interface Matchers<T> {
toBeDisplayed(): Promise<void>;
toBePresent(): Promise<void>;
toHaveText(expectedText: string): Promise<void>;
toContainText(expectedText: string): Promise<void>;
}
}

@@ -6,10 +6,10 @@ "use strict";

toBeDisplayed() {
const result = {
pass: false,
message: '',
};
return {
compare(element) {
const result = {
pass: false,
message: '',
};
result.pass = utils_1.isElementDisplayed(element);
result.message = `Expected element '${element.locator().value}' to be displayed on the page`;
result.pass = utils_1.isElementDisplayed(element);
return result;

@@ -19,3 +19,46 @@ },

},
toBePresent() {
return {
compare(element) {
const result = {
pass: false,
message: '',
};
result.pass = utils_1.isElementPresent(element);
result.message = `Expected element '${element.locator().value}' to be present on the page`;
return result;
},
};
},
toHaveText() {
return {
compare(element, expectedText) {
const result = {
pass: false,
message: '',
};
result.pass = utils_1.getElementText(element).then((actualText) => {
result.message = `Expected text '${actualText}' to be ${expectedText}`;
return actualText === expectedText;
});
return result;
},
};
},
toContainText() {
return {
compare(element, expectedText) {
const result = {
pass: false,
message: '',
};
result.pass = utils_1.getElementText(element).then((actualText) => {
result.message = `Expected text '${actualText}' to contain ${expectedText}`;
return actualText.includes(expectedText);
});
return result;
},
};
},
};
module.exports = customMatchers;

@@ -12,3 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isElementDisplayed = void 0;
exports.getElementText = exports.isElementPresent = exports.isElementDisplayed = void 0;
function isElementDisplayed(element) {

@@ -26,1 +26,13 @@ return __awaiter(this, void 0, void 0, function* () {

exports.isElementDisplayed = isElementDisplayed;
function isElementPresent(element) {
return __awaiter(this, void 0, void 0, function* () {
return element.isPresent();
});
}
exports.isElementPresent = isElementPresent;
function getElementText(element) {
return __awaiter(this, void 0, void 0, function* () {
return element.getText();
});
}
exports.getElementText = getElementText;
{
"name": "expect-protractor",
"version": "1.0.6",
"version": "1.0.7",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc