Skip to content

Commit d219976

Browse files
committed
wip: try using actions with execute
1 parent b281096 commit d219976

File tree

12 files changed

+260
-69
lines changed

12 files changed

+260
-69
lines changed

injected/integration-test/page-objects/results-collector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class ResultsCollector {
163163
android: async () => {
164164
// noop
165165
},
166-
'android-autofill-password-import': async () => {
166+
'android-autofill-import': async () => {
167167
// noop
168168
},
169169
});
@@ -173,7 +173,7 @@ export class ResultsCollector {
173173
'apple-isolated': () => mockWebkitMessaging,
174174
windows: () => mockWindowsMessaging,
175175
android: () => mockAndroidMessaging,
176-
'android-autofill-password-import': () => mockAndroidMessaging,
176+
'android-autofill-import': () => mockAndroidMessaging,
177177
});
178178

179179
await this.page.addInitScript(messagingMock, {
@@ -187,7 +187,7 @@ export class ResultsCollector {
187187
'apple-isolated': () => wrapWebkitScripts,
188188
apple: () => wrapWebkitScripts,
189189
android: () => wrapWebkitScripts,
190-
'android-autofill-password-import': () => wrapWebkitScripts,
190+
'android-autofill-import': () => wrapWebkitScripts,
191191
windows: () => wrapWindowsScripts,
192192
});
193193

injected/integration-test/type-helpers.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Build {
6161
android: () => '../build/android/contentScope.js',
6262
apple: () => '../build/apple/contentScope.js',
6363
'apple-isolated': () => '../build/apple/contentScopeIsolated.js',
64-
'android-autofill-password-import': () => '../build/android/autofillPasswordImport.js',
64+
'android-autofill-import': () => '../build/android/autofillPasswordImport.js',
6565
'android-broker-protection': () => '../build/android/brokerProtection.js',
6666
});
6767
return readFileSync(path, 'utf8');
@@ -79,7 +79,7 @@ export class Build {
7979
'windows',
8080
'integration',
8181
'android',
82-
'android-autofill-password-import',
82+
'android-autofill-import',
8383
'chrome-mv3',
8484
'firefox',
8585
];

injected/playwright.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export default defineConfig({
5555
use: { injectName: 'android', platform: 'android', ...devices['Galaxy S5'] },
5656
},
5757
{
58-
name: 'android-autofill-password-import',
58+
name: 'android-autofill-import',
5959
testMatch: ['integration-test/autofill-password-import.spec.js'],
60-
use: { injectName: 'android-autofill-password-import', platform: 'android', ...devices['Galaxy S5'] },
60+
use: { injectName: 'android-autofill-import', platform: 'android', ...devices['Galaxy S5'] },
6161
},
6262
{
6363
name: 'chrome-mv3',

injected/scripts/entry-points.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const builds = {
3131
input: 'entry-points/android.js',
3232
output: ['../build/android/brokerProtection.js'],
3333
},
34-
'android-autofill-password-import': {
34+
'android-autofill-import': {
3535
input: 'entry-points/android.js',
3636
output: ['../build/android/autofillPasswordImport.js'],
3737
},

injected/src/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const platformSupport = {
5050
],
5151
android: [...baseFeatures, 'webCompat', 'breakageReporting', 'duckPlayer', 'messageBridge'],
5252
'android-broker-protection': ['brokerProtection'],
53-
'android-autofill-password-import': ['autofillPasswordImport'],
53+
'android-autofill-import': ['autofillPasswordImport'],
5454
'android-adsjs': [
5555
'apiManipulation',
5656
'webCompat',
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
2+
3+
export class Steps {
4+
5+
get disselectAllButtonSelector() {
6+
return `${this.tabPanelSelector} div:nth-child(2) div:nth-child(2)`;
7+
}
8+
9+
get bookmarkModalSelector() {
10+
return 'fieldset.rcetic';
11+
}
12+
13+
get bookmarkSelectButtonSelector() {
14+
return `${this.bookmarkModalSelector} input`;
15+
}
16+
17+
get bookmarkDisselectAllButtonSelector() {
18+
return `${this.bookmarkModalSelector} div:nth-child(2) button:nth-of-type(2)`;
19+
}
20+
21+
get chromeInputCheckboxSelector() {
22+
return `${this.tabPanelSelector} div:nth-child(10) input[type="checkbox"]`;
23+
}
24+
25+
get chromeSectionSelector() {
26+
return 'c-wiz [data-id="chrome"]';
27+
}
28+
29+
get chromeDataButtonSelector() {
30+
return `${this.tabPanelSelector} div:nth-child(10) > div:nth-child(2) > div:nth-child(2) button`;
31+
}
32+
33+
get nextStepButtonSelector() {
34+
return `${this.tabPanelSelector} > div:nth-child(1) > div:nth-child(2) button`;
35+
}
36+
37+
get createExportButtonSelector() {
38+
return 'div[data-configure-step="1"] button';
39+
}
40+
41+
get tabPanelSelector() {
42+
return 'div[role="tabpanel"]';
43+
}
44+
45+
get inputCheckboxSelector() {
46+
return `${this.tabPanelSelector} input[type="checkbox"]`;
47+
}
48+
49+
get okButtonSelector() {
50+
return 'div[isfullscreen] div:nth-child(3) div:last-child';
51+
}
52+
53+
get bookmarkCheckboxSelector() {
54+
return `${this.bookmarkModalSelector} div:nth-child(3) > div:nth-of-type(2) input`;
55+
}
56+
57+
/**
58+
* @returns {Array<Record<string, any>>}
59+
*/
60+
get actions() {
61+
return [
62+
{
63+
id: 'disselect-all-button-click',
64+
actionType: 'click',
65+
elements: [{
66+
type: 'element',
67+
selector: this.disselectAllButtonSelector
68+
}]
69+
},
70+
{
71+
id: 'chrome-section-scroll',
72+
actionType: 'scroll',
73+
selector: this.chromeSectionSelector
74+
},
75+
{
76+
id: 'chrome-section-select',
77+
actionType: 'click',
78+
elements: [{
79+
type: 'element',
80+
selector: `${this.chromeSectionSelector} input`
81+
}]
82+
},
83+
{
84+
id: 'chrome-data-button-click',
85+
actionType: 'click',
86+
elements: [{
87+
type: 'element',
88+
selector: this.chromeDataButtonSelector
89+
}]
90+
},
91+
{
92+
id: 'bookmark-modal-expectation',
93+
actionType: 'expectation',
94+
elements: [{
95+
type: 'element',
96+
selector: this.bookmarkModalSelector
97+
}]
98+
},
99+
{
100+
id: 'bookmark-disselect-all-button-click',
101+
actionType: 'click',
102+
elements: [{
103+
type: 'element',
104+
selector: this.bookmarkDisselectAllButtonSelector
105+
}]
106+
},
107+
{
108+
id: 'bookmark-checkbox-expectation',
109+
actionType: 'expectation',
110+
expectations: [{
111+
type: 'element',
112+
selector: this.bookmarkCheckboxSelector
113+
}]
114+
},
115+
{
116+
id: 'bookmark-checkbox-click',
117+
actionType: 'click',
118+
elements: [{
119+
type: 'element',
120+
selector: this.bookmarkCheckboxSelector
121+
}]
122+
},
123+
{
124+
id: 'ok-button-expectation',
125+
actionType: 'expectation',
126+
expectations: [{
127+
type: 'element',
128+
selector: this.okButtonSelector
129+
}]
130+
},
131+
{
132+
id: 'ok-button-click',
133+
actionType: 'click',
134+
elements: [{
135+
type: 'element',
136+
selector: this.okButtonSelector
137+
}]
138+
},
139+
{
140+
id: 'next-step-button-scroll',
141+
actionType: 'scroll',
142+
elements: [{
143+
type: 'element',
144+
selector: this.nextStepButtonSelector
145+
}]
146+
},
147+
{
148+
id: 'next-step-button-click',
149+
actionType: 'click',
150+
elements: [{
151+
type: 'element',
152+
selector: this.nextStepButtonSelector
153+
}]
154+
},
155+
{
156+
id: 'create-export-button-scroll',
157+
actionType: 'scroll',
158+
selector: this.createExportButtonSelector
159+
},
160+
{
161+
id: 'create-export-button-click',
162+
actionType: 'click',
163+
elements: [{
164+
type: 'element',
165+
selector: this.createExportButtonSelector
166+
}]
167+
}
168+
];
169+
}
170+
}
171+
172+

0 commit comments

Comments
 (0)