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
{ | |
"devDependencies": { | |
"@synthetixio/synpress": "^1.1.1", | |
"@testing-library/cypress": "^8.0.2", | |
"cypress": "^9.5.1", | |
"eslint-plugin-cypress": "^2.12.1", | |
"eslint-plugin-testing-library": "^5.0.6" | |
}, | |
"name": "my-dApp", | |
"version": "1.0.0", |
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
{ | |
"baseUrl": "http://localhost:3000", | |
"userAgent": "synpress", | |
"retries": { "runMode": 0, "openMode": 0 }, | |
"integrationFolder": "integration", | |
"screenshotsFolder": "screenshots", | |
"videosFolder": "videos", | |
"video": true, | |
"chromeWebSecurity": true, | |
"viewportWidth": 1366, |
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
const path = require('path'); | |
const synpressPath = path.join( | |
process.cwd(), | |
'/node_modules/@synthetixio/synpress', | |
); | |
module.exports = { | |
extends: `${synpressPath}/.eslintrc.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
Show hidden characters
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"baseUrl": "../../node_modules", | |
"types": [ | |
"cypress", | |
"@types/puppeteer-core", | |
"@synthetixio/synpress/support", | |
"cypress-wait-until", | |
"@testing-library/cypress" |
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
import "@testing-library/cypress/add-commands"; | |
Cypress.Commands.add("login", () => { | |
cy.visit("/"); | |
cy.get("[data-cy=metamaskButton]").then((button) => { | |
const acceptAllAccount = true; | |
if (button.text() === "Connect Wallet") { | |
button.trigger("click"); | |
cy.acceptMetamaskAccess(acceptAllAccount).then((connected) => { | |
expect(connected).to.be.true; |
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
import "./commands"; | |
import "@synthetixio/synpress/support"; |
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
NETWORK_NAME=localhost | |
SECRET_WORDS="test, test, test, test, test, test, test, test, test, test, test, junk" |
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
describe("Login Account", () => { | |
before(() => { | |
cy.disconnectMetamaskWalletFromAllDapps(); | |
}); | |
it("Should show connect wallet if not logged in", () => { | |
cy.visit("/"); | |
cy.findByRole("button", { name: /connect wallet/i }).should("be.visible"); | |
}); |
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
cy.switchMetamaskAccount(1).then((accountSwitched) => { | |
expect(accountSwitched).to.be.true; | |
}); | |
cy.confirmMetamaskSignatureRequest().then((confirmed) => { | |
expect(confirmed).to.be.true; | |
}); |
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
npx synpress run -cf synpress.json --config supportFile='support/index.js' |
OlderNewer