Skip to content

Commit 6a198f3

Browse files
committed
Merge branch 'master' of github.com:mailslurp/examples
2 parents b71ccc1 + 2d75a01 commit 6a198f3

File tree

11 files changed

+2441
-227
lines changed

11 files changed

+2441
-227
lines changed

.build/shortcodes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ async function getFileTree(path: string): Promise<string> {
196196
paths: await files(
197197
"/javascript-cypress-sms-testing/**/*.ts",
198198
"/javascript-cypress-sms-testing/cypress/support/*.js",
199+
"/wait-for-methods-vitest/*.ts",
199200
"/nodejs-nodemailer-smtp-example/spec/*Spec.js"
200201
),
201202
commentStart: "//<gen>",

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ copy-manifest:
2424
aws s3 cp .manifest.json s3://assets.mailslurp.com/examples/manifest.json
2525

2626
copy-shortcodes:
27-
aws s3 sync shortcodes/ s3://api-spec.mailslurp.com/shortcodes-github --exact-timestamps
27+
aws s3 sync shortcodes/ s3://api-spec.mailslurp.com/shortcodes-github
2828

2929
copy-screenshots:
30-
aws s3 cp php-laravel-phpunit/tests/Browser/screenshots/ s3://api-spec.mailslurp.com/test-screenshots/examples/php-laravel-phpunit --exact-timestamps
30+
aws s3 cp php-laravel-phpunit/tests/Browser/screenshots/ s3://api-spec.mailslurp.com/test-screenshots/examples/php-laravel-phpunit

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

+45-46
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,56 @@ describe("user sign up test with mailslurp plugin", function () {
1515
})
1616
});
1717
//</gen>
18-
//<gen>cypress_plugin_01
1918
it("01 - can load the demo application", function () {
19+
//<gen>cypress_plugin_01
2020
// get wrapped email address and assert contains a mailslurp email address
2121
expect(this.emailAddress).to.contain("@mailslurp");
2222
// visit the demo application
2323
cy.visit("https://playground.mailslurp.com")
2424
cy.title().should('contain', 'React App');
25+
//</gen>
26+
//<gen>cypress_plugin_02
27+
cy.then(function () {
28+
// click sign up and fill out the form
29+
cy.get("[data-test=sign-in-create-account-link]").click()
30+
// use the email address and a test password
31+
cy.get("[name=email]").type(this.emailAddress).trigger('change');
32+
cy.get("[name=password]").type('test-password').trigger('change');
33+
// click the submit button
34+
cy.get("[data-test=sign-up-create-account-button]").click();
35+
//</gen>
36+
})
37+
//<gen>cypress_plugin_03
38+
cy.then(function () {
39+
// app will send user an email containing a code, use mailslurp to wait for the latest email
40+
cy.mailslurp()
41+
// use inbox id and a timeout of 30 seconds
42+
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
43+
// extract the confirmation code from the email body
44+
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
45+
// fill out the confirmation form and submit
46+
.then(code => {
47+
cy.get("[name=code]").type(code).trigger('change');
48+
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
49+
})
50+
})
51+
//</gen>
52+
//<gen>cypress_plugin_04
53+
// fill out sign in form
54+
cy.then( function () {
55+
// use the email address and a test password
56+
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
57+
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
58+
// click the submit button
59+
cy.get("[data-test=sign-in-sign-in-button]").click();
60+
});
61+
//</gen>
62+
//<gen>cypress_plugin_05
63+
// can see authorized welcome screen
64+
cy.then(function () {
65+
// click sign up and fill out the form
66+
cy.get("h1").should("contain", "Welcome");
67+
})
68+
//</gen>
2569
});
26-
//</gen>
27-
//<gen>cypress_plugin_02
28-
// use function instead of arrow syntax to access aliased values on this
29-
it("02 - can sign up using email address", function () {
30-
// click sign up and fill out the form
31-
cy.get("[data-test=sign-in-create-account-link]").click()
32-
// use the email address and a test password
33-
cy.get("[name=email]").type(this.emailAddress).trigger('change');
34-
cy.get("[name=password]").type('test-password').trigger('change');
35-
// click the submit button
36-
cy.get("[data-test=sign-up-create-account-button]").click();
37-
});
38-
//</gen>
39-
//<gen>cypress_plugin_03
40-
it("03 - can receive confirmation code by email", function () {
41-
// app will send user an email containing a code, use mailslurp to wait for the latest email
42-
cy.mailslurp()
43-
// use inbox id and a timeout of 30 seconds
44-
.then(mailslurp => mailslurp.waitForLatestEmail(this.inboxId, 30000, true))
45-
// extract the confirmation code from the email body
46-
.then(email => /.*verification code is (\d{6}).*/.exec(email.body!!)!![1])
47-
// fill out the confirmation form and submit
48-
.then(code => {
49-
cy.get("[name=code]").type(code).trigger('change');
50-
cy.get("[data-test=confirm-sign-up-confirm-button]").click();
51-
})
52-
});
53-
//</gen>
54-
//<gen>cypress_plugin_04
55-
// fill out sign in form
56-
it("04 - can sign in with confirmed account", function () {
57-
// use the email address and a test password
58-
cy.get("[data-test=username-input]").type(this.emailAddress).trigger('change');
59-
cy.get("[data-test=sign-in-password-input]").type('test-password').trigger('change');
60-
// click the submit button
61-
cy.get("[data-test=sign-in-sign-in-button]").click();
62-
});
63-
//</gen>
64-
//<gen>cypress_plugin_05
65-
// can see authorized welcome screen
66-
it("05 - can see welcome screen", function () {
67-
// click sign up and fill out the form
68-
cy.get("h1").should("contain", "Welcome");
69-
});
70-
//</gen>
7170
});

0 commit comments

Comments
 (0)