-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
55 lines (43 loc) · 1.16 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require('dotenv').config()
const puppeteer = require('puppeteer');
const expect = require('expect-puppeteer');
const SignInTest = require('./sign-in-test');
const SignOutTest = require('./sign-out-test');
const UpdateProfileTest = require('./update-profile-test');
expect.setDefaultOptions({ timeout: 5000 });
(async () => {
//Launch Puppeteer
const browser = await puppeteer.launch({
args: ['--incognito'],
headless: false,
args:[
'--start-maximized'
]
});
const pages = await browser.pages();
const page = pages[0];
//Configure Browser
await page.setViewport({
width: 1280,
height: 720,
});
//Main Code
try {
await page.goto('https://collab-calendar.vercel.app/login');
await new SignInTest({
debug: true,
screenshot: true,
}).testAll(page);
await new SignOutTest({
debug: true,
screenshot: true,
}).testAll(page);
await new UpdateProfileTest({
debug: true,
screenshot: true,
}).testAll(page);
}
finally {
await browser.close();
}
})();