This repository has been archived by the owner on Aug 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
130 lines (90 loc) · 7.25 KB
/
test.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
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
130
const { webkit } = require('playwright');
(async () => {
const browser = await webkit.launch({
headless: false
});
const context = await browser.newContext();
// Open new page
const page = await context.newPage();
// Go to https://bi-ej.maps.arcgis.com/home/index.html
await page.goto('https://bi-ej.maps.arcgis.com/home/index.html');
// Go to https://bi-ej.maps.arcgis.com/home/signin.html?returnUrl=https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Findex.html
await page.goto('https://bi-ej.maps.arcgis.com/home/signin.html?returnUrl=https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Findex.html');
// Go to https://bi-ej.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=arcgisonline&display=default&response_type=token&state=%7B%22returnUrl%22%3A%22https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Findex.html%22%2C%22useLandingPage%22%3Afalse%7D&expiration=20160&locale=ja-jp&redirect_uri=https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=false&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&redirectToUserOrgUrl=true
await page.goto('https://bi-ej.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=arcgisonline&display=default&response_type=token&state=%7B%22returnUrl%22%3A%22https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Findex.html%22%2C%22useLandingPage%22%3Afalse%7D&expiration=20160&locale=ja-jp&redirect_uri=https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Faccountswitcher-callback.html&force_login=false&hideCancel=true&showSignupOption=true&canHandleCrossOrgSignIn=true&signuptype=esri&redirectToUserOrgUrl=true');
// Click input[aria-label="ユーザー名"]
await page.click('input[aria-label="ユーザー名"]');
// Fill input[aria-label="ユーザー名"]
await page.fill('input[aria-label="ユーザー名"]', 'Atsuhito.N');
// Press Tab
await page.press('input[aria-label="ユーザー名"]', 'Tab');
// Fill input[aria-label="パスワード"]
await page.fill('input[aria-label="パスワード"]', 'noam1125');
// Press a with modifiers
await page.press('input[aria-label="パスワード"]', 'Control+a');
// Fill input[aria-label="パスワード"]
await page.fill('input[aria-label="パスワード"]', 'noam1125');
// Click text="サイン イン"
await page.click('text="サイン イン"');
// assert.equal(page.url(), 'https://bi-ej.maps.arcgis.com/home/accountswitcher-callback.html#access_token=XbAUk6GMXugqZNH2WkxfJqE2hcwJmpr7MAovstYJHn6dpXAtAmyNjneWQTnQPa0xQ9dAFeEbzbXqRsjBc_Uy7uPJe8xBVVevai642KEjU_H3uJ3BuswJ5sg9Z_Rc7Y_5dk6hJa9SxxXuZTexfUM2kXdcZq1vQUw0fYum5pD7awxCizbJKdTUrLSJGowBKZz7hRRYu2yWSPsDG3DCDFcOqC2mCTfO64KF8rYJqVykMkE.&expires_in=1209600&username=Atsuhito.N&ssl=true&state=%7B%22returnUrl%22%3A%22https%3A%2F%2Fbi-ej.maps.arcgis.com%2Fhome%2Findex.html%22%2C%22useLandingPage%22%3Afalse%7D');
// Go to https://bi-ej.maps.arcgis.com/home/accountswitcher-callback.html#
await page.goto('https://bi-ej.maps.arcgis.com/home/accountswitcher-callback.html#');
// Go to https://bi-ej.maps.arcgis.com/home/index.html
await page.goto('https://bi-ej.maps.arcgis.com/home/index.html');
// Click //button[normalize-space(@aria-label)='アプリ ランチャー']/span/span
await page.click('//button[normalize-space(@aria-label)=\'アプリ ランチャー\']/span/span');
// Click //a[normalize-space(.)='Insights']
const [page1] = await Promise.all([
page.waitForEvent('popup'),
page.click('//a[normalize-space(.)=\'Insights\']')
]);
// Go to https://insights.arcgis.com/#access_token=lEBdzlPqcJua5SgZhaXR5ztwDmV0_acNAijPW8s8EL7Lp3Hy6emJI73uqZe-B6PdAgupeclZuNc_SOOktLBBQecZXKCeXXs279cwvOrtdJ_zGnWqT-4gGfaIXsuAOtWo_xm0e_HO53LXdPbeU0bKwkjmlQ8zAsAgliPkO3pJU7vtcw_uox69MGNGbxmvVu4SHOnA2QRVPxPTTE09zYjzINK6y7H95arqzA6gLwL6lhA.&expires_in=1209479&username=Atsuhito.N&ssl=true&state=%7B%22portalUrl%22%3A%22https%3A%2F%2Fwww.arcgis.com%22%7D
await page1.goto('https://insights.arcgis.com/#access_token=lEBdzlPqcJua5SgZhaXR5ztwDmV0_acNAijPW8s8EL7Lp3Hy6emJI73uqZe-B6PdAgupeclZuNc_SOOktLBBQecZXKCeXXs279cwvOrtdJ_zGnWqT-4gGfaIXsuAOtWo_xm0e_HO53LXdPbeU0bKwkjmlQ8zAsAgliPkO3pJU7vtcw_uox69MGNGbxmvVu4SHOnA2QRVPxPTTE09zYjzINK6y7H95arqzA6gLwL6lhA.&expires_in=1209479&username=Atsuhito.N&ssl=true&state=%7B%22portalUrl%22%3A%22https%3A%2F%2Fwww.arcgis.com%22%7D');
// Go to https://insights.arcgis.com/#
await page1.goto('https://insights.arcgis.com/#');
// Go to https://insights.arcgis.com/#/
await page1.goto('https://insights.arcgis.com/#/');
// Click //div[normalize-space(.)='ワークブック' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'ワークブック\' and normalize-space(@role)=\'link\']');
// Click //div[normalize-space(.)='モデル' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'モデル\' and normalize-space(@role)=\'link\']');
// Click //div[normalize-space(.)='データセット' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'データセット\' and normalize-space(@role)=\'link\']');
// Click //div[normalize-space(.)='接続' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'接続\' and normalize-space(@role)=\'link\']');
// Click //div[normalize-space(.)='ページ' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'ページ\' and normalize-space(@role)=\'link\']');
// Click //div[normalize-space(.)='テーマ' and normalize-space(@role)='link']
await page1.click('//div[normalize-space(.)=\'テーマ\' and normalize-space(@role)=\'link\']');
// Click span[role="application"] div[role="link"]
await page1.click('span[role="application"] div[role="link"]');
// Click img[alt="ヘルプ"]
await page1.click('img[alt="ヘルプ"]');
// Click text="Insights について"
await page1.click('text="Insights について"');
// Click img[alt="閉じる"]
await page1.click('img[alt="閉じる"]');
// Click img[alt="ヘルプ"]
await page1.click('img[alt="ヘルプ"]');
// Click text="Insights へようこそ"
await page1.click('text="Insights へようこそ"');
// Click //a[normalize-space(.)='次へ' and normalize-space(@role)='button']/span[1]
await page1.click('//a[normalize-space(.)=\'次へ\' and normalize-space(@role)=\'button\']/span[1]');
// Click //a[normalize-space(.)='次へ' and normalize-space(@role)='button']/span[1]
await page1.click('//a[normalize-space(.)=\'次へ\' and normalize-space(@role)=\'button\']/span[1]');
// Click //a[normalize-space(.)='次へ' and normalize-space(@role)='button']/span[1]
await page1.click('//a[normalize-space(.)=\'次へ\' and normalize-space(@role)=\'button\']/span[1]');
// Click //a[normalize-space(.)='次へ' and normalize-space(@role)='button']/span[1]
await page1.click('//a[normalize-space(.)=\'次へ\' and normalize-space(@role)=\'button\']/span[1]');
// Click //a[normalize-space(.)='次へ' and normalize-space(@role)='button']/span[1]
await page1.click('//a[normalize-space(.)=\'次へ\' and normalize-space(@role)=\'button\']/span[1]');
// Click text="完了"
await page1.click('text="完了"');
// Close page
await page1.close();
// Close page
await page.close();
// ---------------------
await context.close();
await browser.close();
})();