This file contains hidden or 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
| # Our main pipeline.yml CICD flow | |
| steps: | |
| # We do other steps on every push to a PR and merge to master such as building a Docker image, | |
| # building our JS/HTML/CSS assets, running unit tests, deploying to environments, etc. | |
| # We have the option to trigger selected Cypress tests against our testing/feature branch environment | |
| # for all nonmaster branches before deploying to staging | |
| # We will later parse out the Yes/glob file path values vs. No values when forming the Cypress --spec option | |
| - block: ':cypress: Choose Cypress specs to run in testing environment :cypress:' | |
| branches: '!master' |
This file contains hidden or 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
| // In some page_object.ts | |
| // For this scenario, we have a Cypress test that triggers a download email to be sent to the user's inbox after performing | |
| // some UI steps on the page i.e. clicking a button on the page to export data to a CSV for us to download | |
| // We need to follow the download link in the email back to the web app we own and control to continue the test | |
| redirectToCSVDownloadPageFromEmail({ | |
| user, | |
| pass, | |
| searchString, | |
| }: { | |
| user: string; |
This file contains hidden or 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
| // in an emailjs-imap-client.d.ts so we can type the imap client functions ourselves | |
| declare module 'emailjs-imap-client'; | |
| // squirrelmail.ts (where we define all of our email related task functions | |
| import ImapClient, { LOG_LEVEL_NONE as none } from 'emailjs-imap-client'; | |
| const Squirrelmail = () => { | |
| const squirrelmailServer = "somesquirrelmailserver.net" | |
| const port = 993; |
This file contains hidden or 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
| // in an emailjs-imap-client.d.ts so we can type the imap client functions ourselves | |
| declare module 'emailjs-imap-client'; | |
| // squirrelmail.ts (where we define all of our email related task functions | |
| import ImapClient, { LOG_LEVEL_NONE as none } from 'emailjs-imap-client'; | |
| const Squirrelmail = () => { | |
| const squirrelmailServer = "somesquirrelmailserver.net" | |
| const port = 993; |
This file contains hidden or 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
| // in an emailjs-imap-client.d.ts so we can type the imap client functions ourselves | |
| declare module 'emailjs-imap-client'; | |
| // squirrelmail.ts (where we define all of our email related task functions | |
| import ImapClient, { LOG_LEVEL_NONE as none } from 'emailjs-imap-client'; | |
| const Squirrelmail = () => { | |
| const squirrelmailServer = "somesquirrelmailserver.net" | |
| const port = 993; |
This file contains hidden or 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
| // in an emailjs-imap-client.d.ts so we can type the imap client functions ourselves | |
| declare module 'emailjs-imap-client'; | |
| // squirrelmail.ts (where we define all of our email related task functions) | |
| import ImapClient, { LOG_LEVEL_NONE as none } from 'emailjs-imap-client'; | |
| const Squirrelmail = () => { | |
| const squirrelmailServer = "somesquirrelmailserver.net" | |
| const port = 993; |
This file contains hidden or 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:9001", | |
| "chromeWebSecurity": false, | |
| "projectId": "projectidhash", | |
| "blacklistHosts": [ | |
| "*googletagmanager.com", | |
| "*google-analytics.com", | |
| "*moreanalytics.com", | |
| "*moreblockedscripts.com" | |
| ], |
This file contains hidden or 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
| // As an extra escape hatch, you can choose to run or not run certain client-side code during Cypress tests by checking | |
| // for the window.Cypress value. We highlight some example use cases for why you'd need to do this below | |
| // If we're running an A/B experiment where different views may show up for a user, | |
| // we need to make sure it doesn't lead to Cypress test flakiness by choosing not to run A/B tests during Cypress tests | |
| if (!window.Cypress) { | |
| runABExperiment(); | |
| } | |
| // If one of our flows deals with an auto-downloading link which may lead to breaking/pausing Cypress tests |
This file contains hidden or 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
| // selectors.ts at the base of each page's component folder | |
| import { writeSelectorGenerator, readSelectorGenerator } from ‘../path/to/selectorGenerator’; | |
| const selectors = { | |
| addButton: null, | |
| submitButton: “superSubmitButton” | |
| }; | |
| export const Selectors = { | |
| ...readSelectorGenerator(selectors), |
This file contains hidden or 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
| interface WriteHook { | |
| 'data-hook': string; | |
| } | |
| const writeHook = (hook: string): WriteHook => ({ 'data-hook': hook }); | |
| type WriteSelectors<T> = { [P in keyof T]: WriteHook }; | |
| /* | |
| This takes in a general object like |