Skip to content

Commit ab5bc39

Browse files
Razzwanorenyodfat
authored andcommitted
tests: moved tests to newest 6 version of wdio
1 parent 5b8875a commit ab5bc39

25 files changed

+2538
-2167
lines changed

Diff for: .eslintrc

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"settings": {
1717
"react": {
18-
"version": "detect", // React version. "detect" automatically picks the version you have installed.
18+
"version": "detect" // React version. "detect" automatically picks the version you have installed.
1919
}
2020
},
2121
"rules": {
@@ -72,11 +72,12 @@
7272
"comma-dangle": ["error" ,"always-multiline"],
7373
"semi": ["error", "always"],
7474
"eol-last": "error",
75-
"eqeqeq": "error",
75+
"eqeqeq": "error"
7676
},
7777
"parser": "@typescript-eslint/parser",
7878
"plugins": ["@typescript-eslint", "react"],
7979
"parserOptions": {
8080
"project": "./tsconfig.eslint.json"
81-
}
81+
},
82+
"ignorePatterns": ["test/**/*.conf.js"]
8283
}

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ subgraph.yaml
1717
build/
1818
*.scss.d.ts
1919
*.ps1
20+
.idea
21+
22+
test/integration/.dist

Diff for: CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
## 1.0.2
1+
## 1.0.3
22
- Features Added
33
- First loading speed improvement
4+
- Pages loading process was split to several chunk which is improved UX
5+
6+
- Bugs Fixed
7+
- Integration tests typescript supporting was added
8+
9+
## 1.0.2
10+
- Features Added
411
- Support Multi-call Generic Scheme
512
- Use subgraph v40_0 and arc.js 0.2.76
613
- Added xGEN / GEN bridge

Diff for: package-lock.json

+2,426-1,825
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@
7575
"test": "wdio ./test/integration/wdio.conf.js",
7676
"test:integration": "wdio ./test/integration/wdio.conf.js --inspect",
7777
"test:integration:headless": "wdio ./test/integration/wdio-headless.conf.js",
78+
"test:i": "wdio ./test/integration/wdio-headless.conf.js",
7879
"test:unit": "jest"
7980
},
8081
"dependencies": {
81-
"3box": "1.20.2",
82+
"3box": "1.22.2",
8283
"@burner-wallet/burner-connect-provider": "^0.1.1",
8384
"@daostack/arc.js": "0.2.76",
8485
"@dorgtech/daocreator-ui": "^1.0.13",
@@ -150,14 +151,15 @@
150151
"@daostack/migration": "0.0.1-rc.47-v0",
151152
"@storybook/addon-info": "^5.0.10",
152153
"@storybook/react": "^5.0.10",
153-
"@types/chai": "^4.1.7",
154+
"@types/chai": "4.2.14",
154155
"@types/classnames": "^2.2.6",
155156
"@types/clone-deep": "^4.0.1",
156157
"@types/geopattern": "^1.2.3",
157158
"@types/graphql": "^14.0.4",
158-
"@types/jest": "^24.0.22",
159+
"@types/jest": "^24.9.1",
159160
"@types/jquery": "^3.3.31",
160161
"@types/mixpanel-browser": "^2.23.1",
162+
"@types/mocha": "8.0.4",
161163
"@types/moment-timezone": "^0.5.12",
162164
"@types/node": "^12.6.8",
163165
"@types/object-hash": "^1.2.0",
@@ -180,16 +182,18 @@
180182
"@types/react-toggle": "^4.0.2",
181183
"@types/react-transition-group": "^2.0.15",
182184
"@types/storybook__react": "^4.0.1",
185+
"@types/uuid": "3.4.9",
183186
"@types/web3": "1.2.2",
184187
"@types/webpack-env": "^1.13.0",
185188
"@typescript-eslint/eslint-plugin": "^2.3.0",
186189
"@typescript-eslint/parser": "^2.3.0",
187-
"@wdio/cli": "^5.11.6",
188-
"@wdio/dot-reporter": "^5.7.8",
189-
"@wdio/local-runner": "^5.11.6",
190-
"@wdio/mocha-framework": "^5.7.14",
191-
"@wdio/selenium-standalone-service": "^5.7.8",
192-
"@wdio/spec-reporter": "^5.11.6",
190+
"@wdio/cli": "6.9.0",
191+
"@wdio/dot-reporter": "6.8.1",
192+
"@wdio/local-runner": "6.9.0",
193+
"@wdio/mocha-framework": "6.8.0",
194+
"@wdio/selenium-standalone-service": "6.9.0",
195+
"@wdio/spec-reporter": "6.8.1",
196+
"@wdio/sync": "6.9.0",
193197
"awesome-typescript-loader": "^5.2.1",
194198
"axios-mock-adapter": "^1.16.0",
195199
"babel-loader": "^8.0.6",
@@ -217,9 +221,10 @@
217221
"style-loader": "^0.23.1",
218222
"terser-webpack-plugin": "^2.3.1",
219223
"ts-jest": "^24.1.0",
220-
"typescript": "^3.6.3",
224+
"typescript": "^3.9.7",
221225
"typings-for-css-modules-loader": "^1.7.0",
222226
"uglifyjs-webpack-plugin": "^2.2.0",
227+
"uuid": "3.4.0",
223228
"webdriverio": "6.8.0",
224229
"webpack": "4.43.0",
225230
"webpack-bundle-analyzer": "^3.6.1",

Diff for: test/integration/daos.ts renamed to test/integration/daos.e2e.ts

-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
const chai = require("chai");
2-
3-
global.expect = chai.expect;
4-
chai.Should();
5-
61
describe("All DAOs", () => {
7-
before(() => {
8-
chai.Should();
9-
});
10-
112
it("Works", async () => {
123
await browser.url("http://127.0.0.1:3000/daos");
134
const title = await browser.getTitle();

Diff for: test/integration/feed.ts renamed to test/integration/feed.e2e.ts

-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import { hideCookieAcceptWindow } from "./utils";
22

3-
const chai = require("chai");
4-
5-
global.expect = chai.expect;
6-
chai.Should();
7-
83
describe("Home page feed", () => {
9-
before(async () => {
10-
chai.Should();
11-
});
12-
134
it("Displays message and all DAOs when not logged in ", async () => {
145
await browser.url("http://127.0.0.1:3000/feed");
156
const title = await browser.getTitle();
File renamed without changes.

Diff for: test/integration/members.ts renamed to test/integration/members.e2e.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import * as chai from "chai";
21
import { getContractAddresses, userAddresses } from "./utils";
32

43
describe("Members page", () => {
5-
let addresses: string[];
4+
let addresses;
65
let daoAddress: string;
76

87
before(async () => {
9-
chai.Should();
108
addresses = getContractAddresses();
119
daoAddress = addresses.dao.Avatar.toLowerCase();
1210
});

Diff for: test/integration/profile.ts renamed to test/integration/profile.e2e.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import * as chai from "chai";
21
import { getContractAddresses, userAddresses } from "./utils";
32

43
describe("Profile page", () => {
54
let addresses;
6-
let daoAddress;
5+
let daoAddress: string;
76
const userAddress = userAddresses[0];
87

98
before(async () => {
10-
chai.Should();
119
addresses = getContractAddresses();
1210
daoAddress = addresses.dao.Avatar.toLowerCase();
1311
});
File renamed without changes.

Diff for: test/integration/rewards.ts renamed to test/integration/rewards.e2e.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import * as chai from "chai";
21
import { getContractAddresses, hideCookieAcceptWindow } from "./utils";
32

4-
chai.should();
5-
63
describe("Header redemptions button", () => {
74
it("shouldn't be there if the user isn't logged in", async () => {
85
await browser.url("http://127.0.0.1:3000");
@@ -36,7 +33,7 @@ describe("Header redemptions button", () => {
3633
// though we're already logged in.
3734
const connectButton = await $("[data-test-id=\"connectButton\"]");
3835
await connectButton.click();
39-
await connectButton.waitForDisplayed(undefined, true);
36+
await connectButton.waitForDisplayed(undefined);
4037

4138
const redemptionsButton = await $("[data-test-id=\"redemptionsButton\"]");
4239
await redemptionsButton.click();
@@ -49,7 +46,7 @@ describe("Header redemptions button", () => {
4946
});
5047

5148
describe("Redemptions page", () => {
52-
let testAddresses;
49+
let testAddresses: any;
5350

5451
before(() => {
5552
testAddresses = getContractAddresses();

Diff for: test/integration/tsconfig.json

+19-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
44
"lib": ["es2015.promise", "es2016", "es2017", "dom", "esnext.asynciterable"],
5-
"module":"commonjs",
5+
"module": "commonjs",
66
"moduleResolution": "node",
7-
"declaration": true,
8-
"declarationDir": "../dist/types",
7+
"declaration": false,
98
"experimentalDecorators": true,
109
"emitDecoratorMetadata": true,
1110
"resolveJsonModule": true,
12-
"sourceMap": true,
11+
"sourceMap": false,
1312
"strict": true,
14-
"target": "es5",
15-
"typeRoots": [
16-
"../node_modules/@types"
13+
"target": "es6",
14+
"outDir": "./.dist/",
15+
"noImplicitAny": true,
16+
"strictPropertyInitialization": true,
17+
"strictNullChecks": true,
18+
19+
"types": [
20+
"node",
21+
"@wdio/mocha-framework",
22+
"@wdio/sync",
23+
"@types/chai",
24+
"@types/mocha"
1725
]
1826
},
1927
"include": [
20-
"."
28+
"./*.ts"
29+
],
30+
"exclude": [
31+
"./*.js"
2132
]
2233
}

Diff for: test/integration/utils.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ const settings = {
1010
txSenderServiceUrl: "https://tx-sender-service.herokuapp.com/send-tx",
1111
};
1212

13-
const chai = require("chai");
14-
15-
global.expect = chai.expect;
16-
chai.Should();
17-
1813
export const LATEST_ARC_VERSION = "0.0.1-rc.19";
1914
// because we do not have a "real" dutchX test, we'll just choose one (older) version
2015
// not thtat the correct address (migration.private.base[VERSION_FOR_DUTCHX_TEST]. GEenericScheme)
@@ -66,7 +61,7 @@ export function getArc() {
6661
*/
6762
export async function hideCookieAcceptWindow(): Promise<void> {
6863
const acceptCookiesButton = await $("*[data-test-id=\"acceptCookiesButton\"]");
69-
if (!acceptCookiesButton.error && await acceptCookiesButton.isDisplayedInViewport()) {
64+
if (!(acceptCookiesButton as any).error && await (acceptCookiesButton as any).isDisplayedInViewport()) {
7065
await acceptCookiesButton.click();
7166
}
7267
}

0 commit comments

Comments
 (0)