Skip to content

Commit

Permalink
Streamline using pre_e2e locally
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulrhmnGhanem committed Jun 29, 2023
1 parent ef92824 commit b7fc780
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ jobs:
shell: bash
run: |
token=$(scripts/pre_e2e.sh)
docker-compose stop
echo "CYPRESS_GITEA_ADMIN_TOKEN=${token}" >> $GITHUB_ENV
- name: e2e
Expand Down
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,22 +335,36 @@ We configure our staging servers using [Ansible](https://docs.ansible.com/ansibl
```console
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.e2e.yml up e2e
```
##

> 🚧 **GITEA_ADMIN_TOKEN is needed because we have hid gitea and it's inaccessible to other containers!**
### Without docker

Make sure that npm packages are installed

```console
yarn --cwd e2e
```
then you can run the tests with

```console
cd e2e
yarn
yarn e2e
yarn --cwd e2e e2e --env GITEA_ADMIN_TOKEN=$(scripts/pre_e2e.sh)
```

### GUI
Make sure that npm packages are installed

```console
cd e2e
yarn
yarn gui
yarn --cwd e2e
```
then you can open the GUI with

```console
yarn --cwd e2e gui --env GITEA_ADMIN_TOKEN=$(scripts/pre_e2e.sh)
```



### Recording new visual tests:

Expand Down
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "kitspace-e2e",
"scripts": {
"e2e": "npx cypress run",
"gui": "npx cypress open",
"e2e": "yarn cypress run",
"gui": "yarn cypress open",
"fmt": "prettier '*.json' cypress/ --write",
"lint": "eslint cypress/"
},
Expand Down
2 changes: 0 additions & 2 deletions scripts/pre_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ else
fi

token="$(deno run --allow-env --allow-net --allow-run ./scripts/importBoardsTxt.ts --tokenOnly)"
docker-compose stop

# reutrn the token so it can be used as $(./scripts/pre_e2e.sh)
echo $token

0 comments on commit b7fc780

Please sign in to comment.