-
Notifications
You must be signed in to change notification settings - Fork 277
Expand file tree
/
Copy pathfuncaptcha.spec.ts
More file actions
129 lines (116 loc) · 4.68 KB
/
Copy pathfuncaptcha.spec.ts
File metadata and controls
129 lines (116 loc) · 4.68 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* PRIVACY RESEARCH USE ONLY
*
* Run exclusively inside authorized privacy research labs with synthetic data only.
* Never target production traffic or violate any Terms of Service.
*
* See https://github.com/botswin/BotBrowser/blob/main/tests/README.md
* and https://github.com/botswin/BotBrowser/blob/main/DISCLAIMER.md
*/
import { expect, test } from '../global-setup';
import { generateRandomEmail, generateRandomPassword, generateRandomUsername, sleep, waitForFrame } from '../utils';
test('blizzard', async ({ page }) => {
await page.goto(`https://account.battle.net/creation/flow/creation-full`);
await page.locator('input[name="dob-plain"]').focus();
await page.keyboard.type('01/01/1998', { delay: 20 });
await page.locator('button#flow-form-submit-btn').click();
await page.locator('input#capture-first-name').pressSequentially(generateRandomUsername(), {
delay: 20,
});
await page.locator('input#capture-last-name').pressSequentially(generateRandomUsername(), {
delay: 20,
});
await page.locator('button#flow-form-submit-btn').click();
await page.locator('input#capture-email').pressSequentially(generateRandomEmail(), { delay: 20 });
await page.locator('button#flow-form-submit-btn').click();
await page.locator('span >> text=By checking this box').click();
await page.locator('button#flow-form-submit-btn').click();
await page.locator('input#capture-password').pressSequentially(generateRandomPassword(), {
delay: 20,
});
await page.locator('button#flow-form-submit-btn').click();
await page.locator('button#flow-form-submit-btn').click();
const fcFrame = await waitForFrame({
page,
url: 'https://blizzard-api.arkoselabs.com/fc/assets/ec-game-core',
});
await fcFrame.locator('button[data-theme="home.verifyButton"]').click();
await page.waitForSelector('div.step-icon--success');
});
test('roblox', async ({ page }) => {
await page.goto(`https://www.roblox.com/`);
await page.locator('select#MonthDropdown').selectOption('Jan');
await page.locator('select#DayDropdown').selectOption('01');
await page.locator('select#YearDropdown').selectOption('1998');
await page.locator('input#signup-username').pressSequentially(generateRandomUsername(), {
delay: 20,
});
await page.locator('input#signup-password').pressSequentially(generateRandomPassword(), {
delay: 20,
});
await page.locator('button#signup-button').click();
await page.waitForNavigation({ url: 'https://www.roblox.com/home' });
});
test('hotmail', async ({ page }) => {
await page.goto(`https://signup.live.com/signup`);
await page.locator('span#liveSwitch').click();
await page.locator('select#domainSelect').selectOption({
value: 'hotmail.com',
});
const username = generateRandomUsername();
const password = generateRandomPassword();
await page.locator('input#usernameInput').pressSequentially(username, {
delay: 20,
});
await page.keyboard.press('Enter');
await page.locator('input#Password').pressSequentially(password, {
delay: 20,
});
await page.keyboard.press('Enter');
await page.locator('input#firstNameInput').pressSequentially(
Math.random()
.toString(36)
.substring(2)
.replace(/[^a-zA-Z]/g, ''),
{ delay: 20 }
);
await page.locator('input#lastNameInput').pressSequentially(
Math.random()
.toString(36)
.substring(2)
.replace(/[^a-zA-Z]/g, ''),
{ delay: 20 }
);
await page.keyboard.press('Enter');
await page.locator('select#BirthMonth').selectOption({
value: '1',
});
await page.locator('select#BirthDay').selectOption({
value: '1',
});
await page.locator('input#BirthYear').pressSequentially('1998', {
delay: 20,
});
await sleep(2000);
await page.locator('button#nextButton').click();
await page
.locator('[data-testid="enforcementFrame"]')
.contentFrame()
.locator('iframe[title="Verification challenge"]')
.contentFrame()
.locator('iframe[title="Visual challenge"]')
.contentFrame()
.getByRole('button', { name: 'Solve puzzle' })
.click();
expect(
await page
.locator('[data-testid="enforcementFrame"]')
.contentFrame()
.locator('iframe[title="Verification challenge"]')
.contentFrame()
.locator('iframe[title="Visual challenge"]')
.contentFrame()
.getByText('(1 of 1)') // It means we have a great environment with only one wave.
.elementHandle()
).toBeTruthy();
});