Skip to content

Commit 9b9b9d7

Browse files
author
jackmahoney
committed
add-more-shortcodes
1 parent 149e659 commit 9b9b9d7

File tree

10 files changed

+450
-469
lines changed

10 files changed

+450
-469
lines changed

javascript-cypress-js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"postinstall": "cypress install"
77
},
88
"dependencies": {
9-
"cypress": "^8.6.0",
10-
"mailslurp-client": "^15.0.1"
9+
"cypress": "^10.5.0",
10+
"mailslurp-client": "^15.13.3"
1111
}
1212
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
requestTimeout: 30000,
5+
responseTimeout: 30000,
6+
defaultCommandTimeout: 30000,
7+
e2e: {
8+
// We've imported your old cypress plugins here.
9+
// You may want to clean this up later by importing these.
10+
setupNodeEvents(on, config) {
11+
return require('./cypress/plugins/index.js')(on, config)
12+
},
13+
},
14+
})

javascript-cypress-mailslurp-plugin/cypress.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

javascript-cypress-mailslurp-plugin/cypress/integration/integration-test.spec.ts renamed to javascript-cypress-mailslurp-plugin/cypress/e2e/integration-test.cy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// <reference types="cypress-mailslurp" />
22

33
describe("user sign up test with mailslurp plugin", function () {
4+
//<gen>cypress_plugin_before
45
// use cypress-mailslurp plugin to create an email address before test
56
before(function () {
67
cy.log("Wrap inbox before test")
@@ -13,13 +14,17 @@ describe("user sign up test with mailslurp plugin", function () {
1314
cy.wrap(inbox.emailAddress).as('emailAddress')
1415
})
1516
});
17+
//</gen>
18+
//<gen>cypress_plugin_01
1619
it("01 - can load the demo application", function () {
1720
// get wrapped email address and assert contains a mailslurp email address
1821
expect(this.emailAddress).to.contain("@mailslurp");
1922
// visit the demo application
2023
cy.visit("https://playground.mailslurp.com")
2124
cy.title().should('contain', 'React App');
2225
});
26+
//</gen>
27+
//<gen>cypress_plugin_02
2328
// use function instead of arrow syntax to access aliased values on this
2429
it("02 - can sign up using email address", function () {
2530
// click sign up and fill out the form
@@ -30,6 +35,8 @@ describe("user sign up test with mailslurp plugin", function () {
3035
// click the submit button
3136
cy.get("[data-test=sign-up-create-account-button]").click();
3237
});
38+
//</gen>
39+
//<gen>cypress_plugin_03
3340
it("03 - can receive confirmation code by email", function () {
3441
// app will send user an email containing a code, use mailslurp to wait for the latest email
3542
cy.mailslurp()
@@ -43,6 +50,8 @@ describe("user sign up test with mailslurp plugin", function () {
4350
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
4451
})
4552
});
53+
//</gen>
54+
//<gen>cypress_plugin_04
4655
// fill out sign in form
4756
it("04 - can sign in with confirmed account", function () {
4857
// use the email address and a test password
@@ -51,9 +60,12 @@ describe("user sign up test with mailslurp plugin", function () {
5160
// click the submit button
5261
cy.get("[data-test=sign-in-sign-in-button]").click();
5362
});
63+
//</gen>
64+
//<gen>cypress_plugin_05
5465
// can see authorized welcome screen
5566
it("05 - can see welcome screen", function () {
5667
// click sign up and fill out the form
5768
cy.get("h1").should("contain", "Welcome");
5869
});
70+
//</gen>
5971
});

javascript-cypress-mailslurp-plugin/cypress/support/index.js renamed to javascript-cypress-mailslurp-plugin/cypress/support/e2e.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17+
//<gen>add_cypress_commands
18+
// add to cypress/support/custom.js
1719
import './commands'
18-
1920
import "cypress-mailslurp";
21+
//</gen>
2022

2123

2224
// Alternatively you can use CommonJS syntax:

0 commit comments

Comments
 (0)