Skip to content

Commit f3ed4f0

Browse files
authored
chore: Bump chai and chai-as-promised (#1016)
* chore: Bump chai and chai-as-promised * remove extra spaces * Update web-e2e-specs.js
1 parent b9cd07a commit f3ed4f0

26 files changed

+218
-132
lines changed

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@
112112
"@semantic-release/changelog": "^6.0.1",
113113
"@semantic-release/git": "^10.0.1",
114114
"@types/bluebird": "^3.5.38",
115-
"@types/chai": "^4.3.5",
116-
"@types/chai-as-promised": "^7.1.5",
117115
"@types/lodash": "^4.14.196",
118116
"@types/mocha": "^10.0.1",
119117
"@types/node": "^20.4.7",
@@ -124,8 +122,8 @@
124122
"android-apidemos": "^4.1.1",
125123
"appium-chromedriver": "^5.1.4",
126124
"async-lock": "^1.0.0",
127-
"chai": "^4.1.2",
128-
"chai-as-promised": "^7.1.1",
125+
"chai": "^5.1.1",
126+
"chai-as-promised": "^8.0.0",
129127
"conventional-changelog-conventionalcommits": "^8.0.0",
130128
"mocha": "^10.0.0",
131129
"rimraf": "^5.0.0",

test/functional/commands/attributes-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

6-
7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
104
describe('element attributes', function () {
115
this.timeout(MOCHA_TIMEOUT);
126

137
let driver;
8+
let chai;
9+
1410
before(async function () {
11+
chai = await import('chai');
12+
const chaiAsPromised = await import('chai-as-promised');
13+
14+
chai.should();
15+
chai.use(chaiAsPromised.default);
16+
1517
driver = await initSession(APIDEMO_CAPS);
1618
});
1719
after(async function () {

test/functional/commands/clipboard-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

64

7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
10-
115
describe('clipboard', function () {
126
this.timeout(MOCHA_TIMEOUT);
137

148
let driver;
9+
let chai;
10+
1511
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
17+
1618
driver = await initSession(APIDEMO_CAPS);
1719
});
1820
after(async function () {

test/functional/commands/contexts-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

64

7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
10-
115
describe('context', function () {
126
this.timeout(MOCHA_TIMEOUT);
137

148
let driver;
9+
let chai;
10+
1511
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
17+
1618
let caps = Object.assign({
1719
appActivity: 'io.appium.android.apis.view.WebView1',
1820
}, APIDEMO_CAPS);

test/functional/commands/element-values-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

64

7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
10-
115
describe('ElementValue', function () {
126
this.timeout(MOCHA_TIMEOUT);
137

148
let driver;
9+
let chai;
10+
1511
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
17+
1618
let caps = Object.assign({
1719
appActivity: 'io.appium.android.apis.app.CustomTitle',
1820
}, APIDEMO_CAPS);

test/functional/commands/find-e2e-specs.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { retryInterval } from 'asyncbox';
42
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
53
import { APIDEMO_CAPS } from '../desired';
64

75

8-
chai.should();
9-
chai.use(chaiAsPromised);
10-
116
describe('find elements', function () {
127
this.timeout(MOCHA_TIMEOUT);
8+
139
let driver;
10+
let chai;
11+
12+
before(async function () {
13+
chai = await import('chai');
14+
const chaiAsPromised = await import('chai-as-promised');
15+
16+
chai.should();
17+
chai.use(chaiAsPromised.default);
18+
});
1419

1520
describe('elementByXPath', function () {
1621

test/functional/commands/jetpack-componse-element-values-e2e-specs.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { COMPOSE_CAPS } from '../desired';
53

6-
chai.should();
7-
chai.use(chaiAsPromised);
84

95
describe('Jetpack Compose', function () {
106
this.timeout(MOCHA_TIMEOUT);
117

128
let driver;
9+
let chai;
10+
11+
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
1317

14-
before(function () {
1518
// For SDK 23 and below Jetpack compose app crashes while running under instrumentation.
1619
if (parseInt(process.env.ANDROID_SDK_VERSION, 10) <= 23) {
1720
this.skip();

test/functional/commands/jetpack-compose-attributes-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { remote } from 'webdriverio';
42
import { MOCHA_TIMEOUT, HOST, PORT } from '../helpers/session';
53
import { COMPOSE_CAPS } from '../desired';
64

75

8-
chai.should();
9-
chai.use(chaiAsPromised);
10-
116
const COMMON_REMOTE_OPTIONS = {
127
hostname: HOST,
138
port: PORT,
@@ -17,8 +12,15 @@ describe('compose node attributes', function () {
1712
this.timeout(MOCHA_TIMEOUT);
1813

1914
let driver;
15+
let chai;
16+
17+
before(async function () {
18+
chai = await import('chai');
19+
const chaiAsPromised = await import('chai-as-promised');
20+
21+
chai.should();
22+
chai.use(chaiAsPromised.default);
2023

21-
before(function () {
2224
// For SDK 23 and below Jetpack compose app crashes while running under instrumentation.
2325
if (parseInt(process.env.ANDROID_SDK_VERSION, 10) <= 23) {
2426
return this.skip();

test/functional/commands/jetpack-compose-e2e-specs.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { COMPOSE_CAPS } from '../desired';
53

6-
chai.should();
7-
chai.use(chaiAsPromised);
84

95
describe('Jetpack Compose', function () {
106
this.timeout(MOCHA_TIMEOUT);
117

128
let driver;
9+
let chai;
10+
11+
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
1317

14-
before(function () {
1518
// For SDK 23 and below Jetpack compose app crashes while running under instrumentation.
1619
if (parseInt(process.env.ANDROID_SDK_VERSION, 10) <= 23) {
1720
this.skip();

test/functional/commands/jetpack-compose-source-e2e-specs.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { DOMParser } from '@xmldom/xmldom';
42
import xpath from 'xpath';
53
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
64
import { COMPOSE_CAPS } from '../desired';
75

86

9-
chai.should();
10-
chai.use(chaiAsPromised);
11-
127
describe('source commands', function () {
138
this.timeout(MOCHA_TIMEOUT);
149

1510
let driver;
11+
let chai;
12+
1613
describe('jetpack-compose app', function () {
1714
before(async function () {
15+
chai = await import('chai');
16+
const chaiAsPromised = await import('chai-as-promised');
17+
18+
chai.should();
19+
chai.use(chaiAsPromised.default);
20+
1821
// For SDK 23 and below Jetpack compose app crashes while running under instrumentation.
1922
if (parseInt(process.env.ANDROID_SDK_VERSION, 10) <= 23) {
2023
return this.skip();

test/functional/commands/keyboard-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import axios from 'axios';
42
import { initSession, deleteSession, MOCHA_TIMEOUT, HOST, PORT } from '../helpers/session';
53
import { APIDEMO_CAPS } from '../desired';
64

75

8-
chai.should();
9-
chai.use(chaiAsPromised);
10-
11-
126
describe('keyboard', function () {
137
this.timeout(MOCHA_TIMEOUT);
148

@@ -34,7 +28,15 @@ describe('keyboard', function () {
3428
};
3529

3630
let driver;
31+
let chai;
32+
3733
before(async function () {
34+
chai = await import('chai');
35+
const chaiAsPromised = await import('chai-as-promised');
36+
37+
chai.should();
38+
chai.use(chaiAsPromised.default);
39+
3840
let caps = Object.assign({
3941
appActivity: 'io.appium.android.apis.view.AutoComplete4',
4042
autoGrantPermissions: true,

test/functional/commands/mobile-e2e-specs.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

6-
chai.should();
7-
chai.use(chaiAsPromised);
84

95
describe('mobile', function () {
106
this.timeout(MOCHA_TIMEOUT);
117

128
let driver;
9+
let chai;
10+
1311
before(async function () {
12+
chai = await import('chai');
13+
const chaiAsPromised = await import('chai-as-promised');
14+
15+
chai.should();
16+
chai.use(chaiAsPromised.default);
17+
1418
driver = await initSession(Object.assign({}, APIDEMO_CAPS, {
1519
espressoBuildConfig: JSON.stringify({
1620
additionalAndroidTestDependencies: ['com.google.android.material:material:1.2.1']

test/functional/commands/move-to-e2e-specs.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

64

7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
105
// TODO: what is this test supposed to do? finding an element in this driver
116
// automatically scrolls to make it visible, so this test always fails
127
describe.skip('moveTo', function () {
138
this.timeout(MOCHA_TIMEOUT);
149

1510
let driver;
11+
let chai;
12+
1613
before(async function () {
14+
chai = await import('chai');
15+
const chaiAsPromised = await import('chai-as-promised');
16+
17+
chai.should();
18+
chai.use(chaiAsPromised.default);
19+
1720
driver = await initSession(APIDEMO_CAPS);
1821
});
1922
after(async function () {

test/functional/commands/orientation-e2e-specs.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import chai from 'chai';
2-
import chaiAsPromised from 'chai-as-promised';
31
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';
42
import { APIDEMO_CAPS } from '../desired';
53

64

7-
chai.should();
8-
chai.use(chaiAsPromised);
9-
10-
115
describe('orientation', function () {
126
this.timeout(MOCHA_TIMEOUT);
137

148
let driver;
9+
let chai;
10+
1511
before(async function () {
1612
driver = await initSession(APIDEMO_CAPS);
13+
14+
chai = await import('chai');
15+
const chaiAsPromised = await import('chai-as-promised');
16+
17+
chai.should();
18+
chai.use(chaiAsPromised.default);
1719
});
1820
after(async function () {
1921
await deleteSession();

0 commit comments

Comments
 (0)