-
-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Travis running cypress (#9411) * updating dependencies to use custom fork of cypress-metamask * add script and options for running cypress tests * add wait-on package for scripting cypress runs * travis docs indicate that bionic will start xvfb by adding it as a service * add migration step * another attempt at including cypress tests * redirect webserver logs to /dev/null * bad idea to move stdout to dev/null * add NETWORK_NAME to travis env file * update runserver command to go to background * updating existing cypress tests to run on ci * update docker-compose file: use default accounts for ganache * add set -x to get more visibility into cypress command args * update call to cypress run to see if travis will recognize flags * try running cypress directly from node_modules * remove set -x now that arguments are making their way to cypress * Cypress testing/add connection metamask wallet test (#9429) * updating dependencies to use custom fork of cypress-metamask * add script and options for running cypress tests * redirect webserver logs to /dev/null * update docker-compose file: use default accounts for ganache * test running connect site with metamask on ci * attempt at passing in env from config * add ganache-cli to dev dependencies * updated script call * moving where NETWORK_NAME is defined * build please * moving network_name again * remove network_name * add superuser creation to script * take two at creating a superuser * third times a charm - create superuser * try loading user data from fixtures * scroll metamask button into view * add cypress settings to gain access to screenshots/videos * no longer need the scrolling command * add updated cypress-run to red-squirrel * create make target and documentation for running cypress tests
- Loading branch information
Showing
17 changed files
with
5,109 additions
and
548 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 |
---|---|---|
|
@@ -57,3 +57,7 @@ src/ | |
_build/ | ||
**/.vs | ||
**/dist/* | ||
|
||
# cypress artifacts | ||
cypress/videos | ||
cypress/screenshots |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#! /bin/bash | ||
set -eou pipefail | ||
|
||
# start ganache and send to background | ||
# using published ganache mnemonic - known globally and not a secret | ||
export SECRET_WORDS="chief loud snack trend chief net field husband vote message decide replace" | ||
node_modules/.bin/ganache-cli -m "${SECRET_WORDS}" -h 0.0.0.0 & | ||
|
||
# build assets | ||
mkdir -p app/assets/{static,media} | ||
export STATICFILES_DIRS="${TRAVIS_BUILD_DIR}/app/assets/" | ||
python3 app/manage.py bundle | ||
yarn run build | ||
|
||
python3 app/manage.py collectstatic --noinput --disable-collectfast | ||
|
||
# set up database | ||
python3 app/manage.py migrate | ||
python3 app/manage.py loaddata "${TRAVIS_BUILD_DIR}/app/app/fixtures/users.json" | ||
python3 app/manage.py loaddata "${TRAVIS_BUILD_DIR}/app/app/fixtures/profiles.json" | ||
|
||
# run app server | ||
python3 app/manage.py runserver 0.0.0.0:8000 & | ||
|
||
# set required env vars and run cypress tests | ||
export NETWORK_NAME=localhost | ||
export PASSWORD="g1tc01nc0" # used in readme for root user account | ||
export CYPRESS_REMOTE_DEBUGGING_PORT=9222 | ||
export VERBOSE=1 | ||
node_modules/.bin/cypress install | ||
node_modules/.bin/wait-on http://0.0.0.0:8000 | ||
node_modules/.bin/cypress run \ | ||
--browser chrome \ | ||
--headed \ | ||
--record \ | ||
--key 23c824d9-b9eb-4aea-88fd-d0bb06a9eb51 |
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 |
---|---|---|
|
@@ -55,6 +55,7 @@ then | |
then | ||
yarn run build | ||
else | ||
yarn cypress install | ||
yarn run webpack & | ||
fi | ||
fi | ||
|
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 +1,5 @@ | ||
{} | ||
{ | ||
"chromeWebSecurity": true, | ||
"baseUrl": "http://localhost:8000", | ||
"projectId": "e7rv3w" | ||
} |
24 changes: 24 additions & 0 deletions
24
cypress/integration/connect-wallet/test_connect_with_metamask.js
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,24 @@ | ||
describe('connect wallet: metamask', () => { | ||
before(() => { | ||
cy.setupMetamask(); | ||
cy.changeMetamaskNetwork('localhost'); | ||
}); | ||
|
||
after(() => { | ||
cy.disconnectMetamaskWallet(); | ||
cy.clearWindows(); | ||
}); | ||
|
||
it('pulls address from metamask accounts', () => { | ||
cy.impersonateUser(); | ||
|
||
cy.get('#navbarDropdownWallet').as('wallet').click(); | ||
cy.contains('Connect Wallet').click(); | ||
cy.contains('MetaMask').click(); | ||
|
||
cy.acceptMetamaskAccess(); | ||
|
||
cy.get('@wallet').click(); | ||
cy.get('#wallet-btn').should('contain.text', 'Change Wallet'); | ||
}); | ||
}); |
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
Oops, something went wrong.