-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef1048c
commit 518d575
Showing
114 changed files
with
458,102 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ tsup.config.ts | |
**/test/** | ||
vite.config.ts | ||
scripts/prepare-packages.ts | ||
tests/e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,6 @@ yarn-error.log* | |
|
||
.idea | ||
.vscode | ||
.parcel-cache | ||
.parcel-cache | ||
|
||
.reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
|
||
RUN yarn | ||
|
||
COPY . . | ||
|
||
EXPOSE 5001 | ||
|
||
CMD [ "yarn", "dev" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: '3' | ||
|
||
services: | ||
thor-solo: | ||
image: vechain/thor:v2.0.0 | ||
container_name: thor-solo | ||
# Install curl for our healthcheck, then start thor solo | ||
entrypoint: | ||
[ | ||
'/bin/sh', | ||
'-c', | ||
"apk update && apk upgrade && apk add curl && thor solo --on-demand --data-dir /data/thor --api-addr 0.0.0.0:8669 --api-cors '*' --api-backtrace-limit -1 --verbosity 4", | ||
] | ||
ports: | ||
- '8669:8669' | ||
- '11235:11235' | ||
healthcheck: | ||
test: curl --fail 0.0.0.0:8669/blocks/0 || exit 1 | ||
interval: '2s' | ||
retries: 30 | ||
|
||
mockserver: | ||
image: mockserver/mockserver:5.14.0 | ||
container_name: mockserver | ||
ports: | ||
- '1080:1080' | ||
environment: | ||
MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties | ||
MOCKSERVER_INITIALIZATION_JSON_PATH: /config/initializerJson.json | ||
volumes: | ||
- type: bind | ||
source: ./src/mock-server | ||
target: /config | ||
|
||
sample: | ||
container_name: sample-react-app | ||
build: | ||
context: ../../examples/sample-react-app | ||
dockerfile: Dockerfile | ||
ports: | ||
- 5001:5001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
{ | ||
"name": "e2e", | ||
"version": "1.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"description": "", | ||
"license": "ISC", | ||
"author": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "cucumber-js", | ||
"test:debug": "DEBUG=cucumber yarn test" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@cucumber/cucumber": "^8.10.0", | ||
"@cucumber/cucumber": "^10.3.1", | ||
"@serenity-js/console-reporter": "^3.4.1", | ||
"@serenity-js/cucumber": "^3.4.1", | ||
"@serenity-js/serenity-bdd": "^3.4.1", | ||
"@types/chrome": "^0.0.262", | ||
"@types/chromedriver": "^81.0.1", | ||
"@types/cucumber": "^7.0.0", | ||
"@vechain/repo-config": "https://github.com/vechainfoundation/repo-config#v0.0.1", | ||
"expect.js": "^0.3.1", | ||
"playwright": "^1.39.0", | ||
"ts-node": "^10.9.1" | ||
"@types/jest": "^29.5.12", | ||
"@types/selenium-webdriver": "^4.1.13", | ||
"@vechain/repo-config": "https://github.com/vechain/repo-config", | ||
"selenium-webdriver": "4.8.2", | ||
"testcontainers": "^10.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ArtifactArchiver, configure } from '@serenity-js/core'; | ||
import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'; | ||
import { ConsoleReporter } from '@serenity-js/console-reporter'; | ||
|
||
configure({ | ||
crew: [ | ||
SerenityBDDReporter.fromJSON({ specDirectory: '../..' }), | ||
ArtifactArchiver.storingArtifactsAt('../../.reports/serenity'), | ||
ConsoleReporter.withDefaultColourSupport(), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { AfterAll, BeforeAll, setDefaultTimeout } from '@cucumber/cucumber'; | ||
import { | ||
DockerComposeEnvironment, | ||
StartedDockerComposeEnvironment, | ||
Wait, | ||
} from 'testcontainers'; | ||
import path from 'path'; | ||
|
||
setDefaultTimeout(180_000); | ||
|
||
let dockerEnvironment: StartedDockerComposeEnvironment; | ||
|
||
BeforeAll(async function () { | ||
console.log('Starting docker compose environment...'); | ||
|
||
if (process.env.DOCKER_RUNNING) { | ||
console.log('Docker environment already running'); | ||
return; | ||
} | ||
|
||
const composePath = path.join(__dirname, '..', '..', '..'); | ||
const composeFile = 'docker-compose.yaml'; | ||
|
||
dockerEnvironment = await new DockerComposeEnvironment( | ||
composePath, | ||
composeFile, | ||
) | ||
.withStartupTimeout(60_000) | ||
.withWaitStrategy('thor-solo', Wait.forHealthCheck()) | ||
.withWaitStrategy( | ||
'sample-react-app', | ||
Wait.forLogMessage('Local: http://localhost:5001'), | ||
) | ||
.withWaitStrategy('mockserver', Wait.forLogMessage('INFO')) | ||
.up(); | ||
|
||
console.log('Docker compose environment started'); | ||
}); | ||
|
||
AfterAll(async function () { | ||
try { | ||
if (dockerEnvironment && !process.env.DOCKER_RUNNING) { | ||
console.log('\nStopping docker compose environment'); | ||
await dockerEnvironment.down(); | ||
console.log('Docker compose environment stopped'); | ||
} else { | ||
console.log('Not stopping docker compose environment'); | ||
} | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { AfterAll, Before } from '@cucumber/cucumber'; | ||
import { | ||
quitWebDriver, | ||
resetWebDriver, | ||
} from '../../extension/selenium/WebDriver'; | ||
|
||
/** | ||
* | ||
* Runs before EACH scenario | ||
* | ||
* Place `@service-worker` above your scenario/feature if you need the service worker for your tests to pass. It takes | ||
* ~2 seconds to ensure the service worker has started, so it will slow tests down a lot if we require it for every test. | ||
*/ | ||
Before(async function (feature) { | ||
let timeout; | ||
|
||
if (feature.pickle.tags.some((tag) => tag.name === '@service-worker')) { | ||
timeout = 3000; | ||
console.log( | ||
'Using a timeout of 3000ms to ensure service worker is ready', | ||
); | ||
} | ||
|
||
console.log('Resetting web driver...'); | ||
await resetWebDriver(timeout); | ||
console.log('Web driver reset'); | ||
}); | ||
|
||
AfterAll(async function () { | ||
console.log('Stopping web driver'); | ||
await quitWebDriver(); | ||
console.log('Web driver stopped'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
PASSWORD: 'myPassword123', | ||
MNEMONIC: | ||
'denial kitchen pet squirrel other broom bar gas better priority spoil cross', | ||
PRIVATE_KEY: | ||
'0x99f0500549792796c14fed62011a51081dc5b5e68fe8bd8a13b86be829c4fd36', | ||
KEYSTORE_PATH: './resources/keystore.json', | ||
KEYSTORE_PASSWORD: 'Password1!', | ||
ADDRESS: '0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa', | ||
TIMEOUT: 5_000, | ||
TRANSACTION_TIMEOUT: 20_000, | ||
DAPP_URL: 'http://localhost:5001', | ||
}; |
Oops, something went wrong.