expect-webdriverio 4.0.0-alpha.0 → 4.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/matchers/browser/toHaveTitle.js +1 -1
- package/lib/matchers/browser/toHaveTitleContaining.js +1 -1
- package/lib/matchers/browser/toHaveUrl.js +1 -1
- package/lib/matchers/browser/toHaveUrlContaining.js +1 -1
- package/lib/matchers/element/toBeClickable.js +1 -1
- package/lib/matchers/element/toBeDisabled.js +1 -1
- package/lib/matchers/element/toBeDisplayed.js +1 -1
- package/lib/matchers/element/toBeDisplayedInViewport.js +1 -1
- package/lib/matchers/element/toBeEnabled.js +1 -1
- package/lib/matchers/element/toBeExisting.js +1 -1
- package/lib/matchers/element/toBeFocused.js +1 -1
- package/lib/matchers/element/toBeSelected.js +1 -1
- package/lib/matchers/element/toHaveAttribute.js +1 -1
- package/lib/matchers/element/toHaveAttributeContaining.js +1 -1
- package/lib/matchers/element/toHaveChildren.js +1 -1
- package/lib/matchers/element/toHaveClass.js +1 -1
- package/lib/matchers/element/toHaveClassContaining.js +1 -1
- package/lib/matchers/element/toHaveElementProperty.js +1 -1
- package/lib/matchers/element/toHaveHref.js +1 -1
- package/lib/matchers/element/toHaveHrefContaining.js +1 -1
- package/lib/matchers/element/toHaveId.js +1 -1
- package/lib/matchers/element/toHaveStyle.js +1 -1
- package/lib/matchers/element/toHaveText.js +1 -1
- package/lib/matchers/element/toHaveTextContaining.js +1 -1
- package/lib/matchers/element/toHaveValue.js +1 -1
- package/lib/matchers/element/toHaveValueContaining.js +1 -1
- package/lib/matchers/elements/toBeElementsArrayOfSize.js +2 -2
- package/lib/matchers/mock/toBeRequested.js +1 -1
- package/lib/matchers/mock/toBeRequestedTimes.js +2 -2
- package/lib/matchers/mock/toBeRequestedWith.js +2 -2
- package/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { waitUntil, enhanceError, compareText } from '../../utils';
|
|
1
|
+
import { waitUntil, enhanceError, compareText } from '../../utils.js';
|
|
2
2
|
export function toHaveTitle(browser, title, options = {}) {
|
|
3
3
|
const isNot = this.isNot;
|
|
4
4
|
const { expectation = 'title', verb = 'have' } = this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { waitUntil, enhanceError, compareText } from '../../utils';
|
|
1
|
+
import { waitUntil, enhanceError, compareText } from '../../utils.js';
|
|
2
2
|
export function toHaveUrl(browser, url, options = {}) {
|
|
3
3
|
const isNot = this.isNot;
|
|
4
4
|
const { expectation = 'url', verb = 'have' } = this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeClickable(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'clickable';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeDisabled(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'disabled';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeDisplayed(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'displayed';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeDisplayedInViewport(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'displayed in viewport';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeEnabled(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'enabled';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe, aliasFn } from '../../utils';
|
|
2
|
+
import { executeCommandBe, aliasFn } from '../../utils.js';
|
|
3
3
|
export function toExist(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'exist';
|
|
5
5
|
this.verb = this.verb || '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeFocused(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'focused';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { executeCommandBe } from '../../utils';
|
|
2
|
+
import { executeCommandBe } from '../../utils.js';
|
|
3
3
|
export function toBeSelected(received, options = {}) {
|
|
4
4
|
this.expectation = this.expectation || 'selected';
|
|
5
5
|
return browser.call(async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareText, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, compareText, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils.js';
|
|
3
3
|
async function conditionAttr(el, attribute) {
|
|
4
4
|
const attr = await el.getAttribute(attribute);
|
|
5
5
|
if (typeof attr !== 'string') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toHaveAttributeAndValueFn } from './toHaveAttribute';
|
|
1
|
+
import { toHaveAttributeAndValueFn } from './toHaveAttribute.js';
|
|
2
2
|
export function toHaveAttributeContaining(el, attribute, value, options = {}) {
|
|
3
3
|
return toHaveAttributeAndValueFn.call(this, el, attribute, value, {
|
|
4
4
|
...options,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareNumbers, numberError, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, compareNumbers, numberError, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, options) {
|
|
4
4
|
const children = await el.$$('./*');
|
|
5
5
|
if (typeof options.lte !== 'number' &&
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, attribute, value, options) {
|
|
4
4
|
const { ignoreCase = false, trim = false, containing = false } = options;
|
|
5
5
|
let attr = await el.getAttribute(attribute);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareText, executeCommand, wrapExpectedWithArray, updateElementsArray, } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, compareText, executeCommand, wrapExpectedWithArray, updateElementsArray, } from '../../utils.js';
|
|
3
3
|
async function condition(el, property, value, options = {}) {
|
|
4
4
|
const { asString = false } = options;
|
|
5
5
|
let prop = await el.getProperty(property);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareStyle, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, compareStyle, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, style, options) {
|
|
4
4
|
return compareStyle(el, style, options);
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareText, compareTextWithArray, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils';
|
|
2
|
+
import { waitUntil, enhanceError, compareText, compareTextWithArray, executeCommand, wrapExpectedWithArray, updateElementsArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, text, options) {
|
|
4
4
|
const actualText = await el.getText();
|
|
5
5
|
if (Array.isArray(text)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareNumbers, numberError, updateElementsArray } from '../../utils';
|
|
3
|
-
import { refetchElements } from '../../util/refetchElements';
|
|
2
|
+
import { waitUntil, enhanceError, compareNumbers, numberError, updateElementsArray } from '../../utils.js';
|
|
3
|
+
import { refetchElements } from '../../util/refetchElements.js';
|
|
4
4
|
export function toBeElementsArrayOfSize(received, expected, options = {}) {
|
|
5
5
|
const isNot = this.isNot;
|
|
6
6
|
const { expectation = 'elements array of size', verb = 'be' } = this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toBeRequestedTimes } from './toBeRequestedTimes';
|
|
1
|
+
import { toBeRequestedTimes } from './toBeRequestedTimes.js';
|
|
2
2
|
export function toBeRequested(received, options = {}) {
|
|
3
3
|
return toBeRequestedTimes.call({ ...(this || {}), expectation: 'called' }, received, { ...options, gte: 1 });
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError, compareNumbers } from '../../utils';
|
|
3
|
-
import { numberError } from '../../util/formatMessage';
|
|
2
|
+
import { waitUntil, enhanceError, compareNumbers } from '../../utils.js';
|
|
3
|
+
import { numberError } from '../../util/formatMessage.js';
|
|
4
4
|
export function toBeRequestedTimes(received, expected = {}, options = {}) {
|
|
5
5
|
const isNot = this.isNot || false;
|
|
6
6
|
const { expectation = `called${typeof expected === 'number' ? ' ' + expected : ''} time${expected !== 1 ? 's' : ''}`, verb = 'be' } = this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { browser } from '@wdio/globals';
|
|
2
|
-
import { waitUntil, enhanceError } from '../../utils';
|
|
3
|
-
import { equals } from '../../jasmineUtils';
|
|
2
|
+
import { waitUntil, enhanceError } from '../../utils.js';
|
|
3
|
+
import { equals } from '../../jasmineUtils.js';
|
|
4
4
|
const STR_LIMIT = 80;
|
|
5
5
|
const KEY_LIMIT = 12;
|
|
6
6
|
export function toBeRequestedWith(received, requestedWith = {}, options = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-webdriverio",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
5
5
|
"description": "WebdriverIO Assertion Library",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
"@typescript-eslint/parser": "^5.33.0",
|
|
57
57
|
"c8": "^7.12.0",
|
|
58
58
|
"eslint": "^8.21.0",
|
|
59
|
+
"eslint-plugin-import": "^2.26.0",
|
|
60
|
+
"eslint-plugin-unicorn": "^43.0.2",
|
|
59
61
|
"husky": "^8.0.1",
|
|
60
62
|
"npm-run-all": "^4.1.5",
|
|
61
63
|
"release-it": "^15.3.0",
|