Skip to content

Commit

Permalink
chore: Bump chai and chai-as-promised (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Jun 23, 2024
1 parent a3d7f93 commit 35734db
Show file tree
Hide file tree
Showing 31 changed files with 284 additions and 171 deletions.
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,19 @@
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/bluebird": "^3.5.38",
"@types/chai": "^4.3.5",
"@types/chai-as-promised": "^7.1.5",
"@types/lodash": "^4.14.194",
"@types/mocha": "^10.0.1",
"@types/node": "^20.2.3",
"@types/portscanner": "^2.1.1",
"@types/semver": "^7.5.0",
"@types/sinon": "^17.0.0",
"@types/sinon-chai": "^3.2.9",
"@types/source-map-support": "^0.x",
"@types/teen_process": "^2.0.0",
"@types/ws": "^8.5.4",
"@xmldom/xmldom": "^0.x",
"android-apidemos": "^4.1.1",
"appium": "^2.0.0-rc.3",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai": "^5.1.1",
"chai-as-promised": "^8.0.0",
"conventional-changelog-conventionalcommits": "^8.0.0",
"fancy-log": "^2.0.0",
"mocha": "^10.0.0",
Expand All @@ -107,7 +103,6 @@
"semantic-release": "^24.0.0",
"sharp": "^0.x",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0",
"ts-node": "^10.9.1",
"typescript": "^5.4.2",
"unzipper": "^0.x",
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/file-movement-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import B from 'bluebird';
import stream from 'stream';
Expand All @@ -8,12 +6,17 @@ import { APIDEMOS_CAPS } from '../desired';
import { initSession, deleteSession } from '../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('file movement', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/by-accessibility-id-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - accessibility ID', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
12 changes: 7 additions & 5 deletions test/functional/commands/find/by-css-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - CSS', function () {
let driver;
let chai;
before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/by-id-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - ID', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
12 changes: 7 additions & 5 deletions test/functional/commands/find/by-image-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import chai from 'chai';
import B from 'bluebird';
import path from 'path';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS, amendCapabilities } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

const START_IMG = path.resolve(__dirname, '..', '..', 'assets', 'start-button.png');
const STOP_IMG = path.resolve(__dirname, '..', '..', 'assets', 'stop-button.png');
const SQUARES_IMG = path.resolve(__dirname, '..', '..', 'assets', 'checkered-squares.png');

describe('Find - Image', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

// TODO: @appium/images-plugin needs to be installed
this.skip();
const caps = amendCapabilities(APIDEMOS_CAPS, {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/by-uiautomator-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - uiautomator', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
await driver.updateSettings({'enableNotificationListener': false});
await driver.setTimeout({ implicit: 20000 });
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/by-xpath-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

const atv = 'android.widget.TextView';
const f = 'android.widget.FrameLayout';

describe('Find - xpath', function () {
let driver;
let chai;

before(async function () {
driver = await initSession(APIDEMOS_CAPS);

chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});
after(async function () {
await deleteSession();
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/find-basic-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - basic', function () {
let driver;
let chai;
let singleResourceId = 'decor_content_parent';

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
12 changes: 7 additions & 5 deletions test/functional/commands/find/find-system-ui-el-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { initSession, deleteSession } from '../../helpers/session';
import { SETTINGS_CAPS } from '../../desired';


chai.should();
chai.use(chaiAsPromised);

describe('Find - android ui elements', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(SETTINGS_CAPS);
});
after(async function () {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/from-el-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - from element', function () {
const atv = 'android.widget.TextView';
const alv = 'android.widget.ListView';
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/find/invalid-strategy-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

describe('Find - invalid strategy', function () {
let driver;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
});
after(async function () {
Expand Down
17 changes: 10 additions & 7 deletions test/functional/commands/general/attribute-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';

chai.should();
chai.use(chaiAsPromised);

let driver;
let animationEl;

describe('apidemo - attributes', function () {
let chai;
let driver;
let animationEl;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

driver = await initSession(APIDEMOS_CAPS);
animationEl = await driver.$('~Animation');
await animationEl.waitForDisplayed({ timeout: 5000 });
Expand Down
16 changes: 10 additions & 6 deletions test/functional/commands/general/context-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { APIDEMOS_CAPS, amendCapabilities } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';


chai.should();
chai.use(chaiAsPromised);

const WEBVIEW = 'WEBVIEW_io.appium.android.apis';
const NATIVE = 'NATIVE_APP';
const NATIVE_LOCATOR = "//*[@class='android.widget.TextView']";
const WEBVIEW_LOCATOR = "//*[text()='This page is a Selenium sandbox']";


describe('apidemo - context', function () {
let chai;
before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);
});

describe('general', function () {
let driver;
before(async function () {
Expand Down
13 changes: 8 additions & 5 deletions test/functional/commands/general/element-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import _ from 'lodash';
import { APIDEMOS_CAPS, amendCapabilities } from '../../desired';
import { initSession, deleteSession } from '../../helpers/session';
import { retryInterval } from 'asyncbox';
import { util } from 'appium/support';


chai.should();
chai.use(chaiAsPromised);

const textFieldsActivity = '.view.TextFields';

describe('apidemo - element', function () {
let driver;
let el;
let chai;

before(async function () {
chai = await import('chai');
const chaiAsPromised = await import('chai-as-promised');

chai.should();
chai.use(chaiAsPromised.default);

const caps = amendCapabilities(APIDEMOS_CAPS, {
'appium:appActivity': textFieldsActivity,
});
Expand Down
Loading

0 comments on commit 35734db

Please sign in to comment.