Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed integration tests and selenium version #36

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@
"plugins": ["@typescript-eslint", "react"],
"parserOptions": {
"project": "./tsconfig.eslint.json"
}
},
"ignorePatterns": ["test/**/*.conf.js"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ subgraph.yaml
build/
*.scss.d.ts
*.css.d.ts
.idea
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_js: 12.18.4
addons:
apt:
update: true
chrome: stable
bundler_args: "--jobs=4 --retry=3"

before_install:
Expand All @@ -13,9 +14,6 @@ before_install:
- export COVERALLS_SERVICE_JOB_ID=$( TRAVIS_JOB_ID )
- export COVERALLS_SERVICE_NAME="travis-ci"

addons:
chrome: stable

jobs:
include:
- stage: tests
Expand Down Expand Up @@ -60,7 +58,7 @@ jobs:
- echo 'npm run build-travis' && echo -en 'travis_fold:start:script.4\\r'
- npm run build-travis
- echo -en 'travis_fold:end:script.4\\r'

- stage: tests
name: "ts/es lint"
script: npm run lint
Expand Down
1,520 changes: 1,189 additions & 331 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"test:unit": "jest"
},
"dependencies": {
"3box": "^1.22.0",
"3box": "1.22.2",
"3id-resolver": "^1.0.1",
"@burner-wallet/burner-connect-provider": "^0.1.1",
"@daostack/arc.js": "2.0.0-experimental.58",
Expand Down Expand Up @@ -168,14 +168,15 @@
"@daostack/test-env-experimental": "4.0.22",
"@storybook/addon-info": "^5.0.10",
"@storybook/react": "^5.0.10",
"@types/chai": "^4.1.7",
"@types/chai": "4.2.14",
"@types/classnames": "^2.2.6",
"@types/clone-deep": "^4.0.1",
"@types/geopattern": "^1.2.3",
"@types/graphql": "^14.0.4",
"@types/jest": "^24.0.22",
"@types/jquery": "^3.3.31",
"@types/mixpanel-browser": "^2.23.1",
"@types/mocha": "8.0.4",
"@types/moment-timezone": "^0.5.12",
"@types/node": "^12.6.8",
"@types/object-hash": "^1.2.0",
Expand All @@ -198,16 +199,18 @@
"@types/react-toggle": "^4.0.2",
"@types/react-transition-group": "^2.0.15",
"@types/storybook__react": "^4.0.1",
"@types/uuid": "3.4.9",
"@types/web3": "1.0.20",
"@types/webpack-env": "^1.13.0",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@wdio/cli": "^6.1.12",
"@wdio/dot-reporter": "^6.1.9",
"@wdio/local-runner": "^6.1.12",
"@wdio/mocha-framework": "^6.1.8",
"@wdio/selenium-standalone-service": "6.4.0",
"@wdio/spec-reporter": "^6.1.12",
"@wdio/dot-reporter": "^6.8.1",
"@wdio/local-runner": "^6.9.0",
"@wdio/mocha-framework": "^6.8.0",
"@wdio/selenium-standalone-service": "^6.4.0",
"@wdio/spec-reporter": "^6.8.1",
"@wdio/sync": "^6.9.0",
"awesome-typescript-loader": "^5.2.1",
"axios-mock-adapter": "^1.16.0",
"babel-loader": "^8.0.6",
Expand Down Expand Up @@ -239,6 +242,7 @@
"typescript": "^3.6.3",
"typings-for-css-modules-loader": "^1.7.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"uuid": "3.4.0",
"webdriverio": "6.4.5",
"webpack": "^4.44.0",
"webpack-bundle-analyzer": "^3.6.1",
Expand Down
9 changes: 0 additions & 9 deletions test/integration/daos.ts → test/integration/daos.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { goToUrl } from "./utils";

const chai = require("chai");

global.expect = chai.expect;
chai.Should();

describe("All DAOs", () => {
before(() => {
chai.Should();
});

it("Works", async () => {
await goToUrl("http://127.0.0.1:3000/daos");
const title = await browser.getTitle();
Expand Down
9 changes: 0 additions & 9 deletions test/integration/feed.ts → test/integration/feed.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { hideCookieAcceptWindow, goToUrl } from "./utils";

const chai = require("chai");

global.expect = chai.expect;
chai.Should();

describe("Home page feed", () => {
before(async () => {
chai.Should();
});

it("Displays message and all DAOs when not logged in ", async () => {
await goToUrl("http://127.0.0.1:3000/feed");
const title = await browser.getTitle();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import * as chai from "chai";
import { getTestAddresses, userAddresses, ITestAddresses, goToUrl } from "./utils";

describe("Members page", () => {
let addresses: ITestAddresses;
let daoAddress: string;

before(async () => {
chai.Should();
addresses = getTestAddresses();
daoAddress = addresses.dao.Avatar.toLowerCase();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as chai from "chai";
import { getTestAddresses, userAddresses, ITestAddresses, goToUrl } from "./utils";

describe("Profile page", () => {
Expand All @@ -7,7 +6,6 @@ describe("Profile page", () => {
const userAddress = userAddresses[0];

before(async () => {
chai.Should();
addresses = getTestAddresses();
daoAddress = addresses.dao.Avatar.toLowerCase();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import * as uuid from "uuid";
import { hideCookieAcceptWindow, gotoDaoPlugins, submit, setCalendarDate } from "./utils";
import * as moment from "moment";

const chai = require("chai");

global.expect = chai.expect;
chai.Should();

describe("Proposals", () => {

beforeEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as uuid from "uuid";
import { LATEST_ARC_VERSION, hideCookieAcceptWindow, ITestAddresses, gotoDaoPlugins } from "./utils";
import { LATEST_ARC_VERSION, hideCookieAcceptWindow, gotoDaoPlugins } from "./utils";

describe("Token Trade Proposals", () => {
let daoAddress: string;
let addresses: ITestAddresses;
let addresses: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roienatan because interface is incorrect and it lead typescript checks issue. Proper way is just fix interface I gues...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roienatan trying to fix, but interface is deeply different. Code works properly, but we don't have correct interface for it


before(() => {
const { daos } = require("@daostack/test-env-experimental/daos.json");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import * as chai from "chai";
import { getTestAddresses, ITestAddresses, hideCookieAcceptWindow, goToUrl } from "./utils";

chai.should();

describe("Header redemptions button", () => {
it("shouldn't be there if the user isn't logged in", async () => {
await goToUrl("http://127.0.0.1:3000");
Expand Down
27 changes: 19 additions & 8 deletions test/integration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,32 @@
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"lib": ["es2015.promise", "es2016", "es2017", "dom", "esnext.asynciterable"],
"module":"commonjs",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"declarationDir": "../dist/types",
"declaration": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"sourceMap": true,
"sourceMap": false,
"strict": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
"target": "es6",
"outDir": "./.dist/",
"noImplicitAny": true,
"strictPropertyInitialization": true,
"strictNullChecks": true,

"types": [
"node",
"@wdio/mocha-framework",
"@wdio/sync",
"@types/chai",
"@types/mocha"
]
},
"include": [
"."
"./*.ts"
],
"exclude": [
"./*.js"
]
}
5 changes: 0 additions & 5 deletions test/integration/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ const settings: IArcOptions & { txSenderServiceUrl: string } = {
txSenderServiceUrl: "https://tx-sender-service.herokuapp.com/send-tx",
};

const chai = require("chai");

global.expect = chai.expect;
chai.Should();

export const LATEST_ARC_VERSION = require("@daostack/migration-experimental/package.json")["dependencies"]["@daostack/arc-experimental"];

export const userAddresses = [
Expand Down
Loading