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.
Files changed (31) hide show
  1. package/lib/matchers/browser/toHaveTitle.js +1 -1
  2. package/lib/matchers/browser/toHaveTitleContaining.js +1 -1
  3. package/lib/matchers/browser/toHaveUrl.js +1 -1
  4. package/lib/matchers/browser/toHaveUrlContaining.js +1 -1
  5. package/lib/matchers/element/toBeClickable.js +1 -1
  6. package/lib/matchers/element/toBeDisabled.js +1 -1
  7. package/lib/matchers/element/toBeDisplayed.js +1 -1
  8. package/lib/matchers/element/toBeDisplayedInViewport.js +1 -1
  9. package/lib/matchers/element/toBeEnabled.js +1 -1
  10. package/lib/matchers/element/toBeExisting.js +1 -1
  11. package/lib/matchers/element/toBeFocused.js +1 -1
  12. package/lib/matchers/element/toBeSelected.js +1 -1
  13. package/lib/matchers/element/toHaveAttribute.js +1 -1
  14. package/lib/matchers/element/toHaveAttributeContaining.js +1 -1
  15. package/lib/matchers/element/toHaveChildren.js +1 -1
  16. package/lib/matchers/element/toHaveClass.js +1 -1
  17. package/lib/matchers/element/toHaveClassContaining.js +1 -1
  18. package/lib/matchers/element/toHaveElementProperty.js +1 -1
  19. package/lib/matchers/element/toHaveHref.js +1 -1
  20. package/lib/matchers/element/toHaveHrefContaining.js +1 -1
  21. package/lib/matchers/element/toHaveId.js +1 -1
  22. package/lib/matchers/element/toHaveStyle.js +1 -1
  23. package/lib/matchers/element/toHaveText.js +1 -1
  24. package/lib/matchers/element/toHaveTextContaining.js +1 -1
  25. package/lib/matchers/element/toHaveValue.js +1 -1
  26. package/lib/matchers/element/toHaveValueContaining.js +1 -1
  27. package/lib/matchers/elements/toBeElementsArrayOfSize.js +2 -2
  28. package/lib/matchers/mock/toBeRequested.js +1 -1
  29. package/lib/matchers/mock/toBeRequestedTimes.js +2 -2
  30. package/lib/matchers/mock/toBeRequestedWith.js +2 -2
  31. 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 { toHaveTitle } from './toHaveTitle';
1
+ import { toHaveTitle } from './toHaveTitle.js';
2
2
  export function toHaveTitleContaining(browser, title, options = {}) {
3
3
  return toHaveTitle.call(this, browser, title, {
4
4
  ...options,
@@ -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,4 +1,4 @@
1
- import { toHaveUrl } from './toHaveUrl';
1
+ import { toHaveUrl } from './toHaveUrl.js';
2
2
  export function toHaveUrlContaining(browser, url, options = {}) {
3
3
  return toHaveUrl.call(this, browser, url, {
4
4
  ...options,
@@ -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,4 +1,4 @@
1
- import { toHaveAttributeAndValueFn } from './toHaveAttribute';
1
+ import { toHaveAttributeAndValueFn } from './toHaveAttribute.js';
2
2
  export function toHaveElementClassContaining(...args) {
3
3
  return toHaveClassContaining.call(this, ...args);
4
4
  }
@@ -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,4 +1,4 @@
1
- import { toHaveAttributeAndValueFn } from './toHaveAttribute';
1
+ import { toHaveAttributeAndValueFn } from './toHaveAttribute.js';
2
2
  export function toHaveHref(el, href, options = {}) {
3
3
  return toHaveAttributeAndValueFn.call(this, el, 'href', href, options);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { toHaveHref } from './toHaveHref';
1
+ import { toHaveHref } from './toHaveHref.js';
2
2
  export function toHaveHrefContaining(el, href, options = {}) {
3
3
  return toHaveHref.call(this, el, href, {
4
4
  ...options,
@@ -1,4 +1,4 @@
1
- import { toHaveAttributeAndValueFn } from './toHaveAttribute';
1
+ import { toHaveAttributeAndValueFn } from './toHaveAttribute.js';
2
2
  export function toHaveId(el, id, options = {}) {
3
3
  return toHaveAttributeAndValueFn.call(this, el, 'id', id, options);
4
4
  }
@@ -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,4 +1,4 @@
1
- import { toHaveText } from './toHaveText';
1
+ import { toHaveText } from './toHaveText.js';
2
2
  export function toHaveTextContaining(el, text, options = {}) {
3
3
  return toHaveText.call(this, el, text, {
4
4
  ...options,
@@ -1,4 +1,4 @@
1
- import { toHaveElementProperty } from './toHaveElementProperty';
1
+ import { toHaveElementProperty } from './toHaveElementProperty.js';
2
2
  export function toHaveValue(el, value, options = {}) {
3
3
  return toHaveElementProperty.call(this, el, 'value', value, options);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { toHaveValue } from './toHaveValue';
1
+ import { toHaveValue } from './toHaveValue.js';
2
2
  export function toHaveValueContaining(el, value, options = {}) {
3
3
  return toHaveValue.call(this, el, value, {
4
4
  ...options,
@@ -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.0",
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",