Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions injected/integration-test/page-objects/results-collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
'android-autofill-password-import': async () => {
// noop
},
integration: async () => {
// noop
},
});

const messagingMock = this.build.switch({
Expand All @@ -174,10 +177,11 @@
windows: () => mockWindowsMessaging,
android: () => mockAndroidMessaging,
'android-autofill-password-import': () => mockAndroidMessaging,
integration: () => mockResponses,
});

await this.page.addInitScript(messagingMock, {
messagingContext: this.messagingContext('n/a'),

Check failure on line 184 in injected/integration-test/page-objects/results-collector.js

View workflow job for this annotation

GitHub Actions / unit (ubuntu-latest)

Object literal may only specify known properties, and 'messagingContext' does not exist in type '{ responses: Record<string, any>; }'.

Check failure on line 184 in injected/integration-test/page-objects/results-collector.js

View workflow job for this annotation

GitHub Actions / snapshots

Object literal may only specify known properties, and 'messagingContext' does not exist in type '{ responses: Record<string, any>; }'.
responses: this.#mockResponses,
messageCallback: 'messageCallback',
javascriptInterface: this.#userPreferences.javascriptInterface,
Expand All @@ -189,6 +193,7 @@
android: () => wrapWebkitScripts,
'android-autofill-password-import': () => wrapWebkitScripts,
windows: () => wrapWindowsScripts,
integration: () => wrapWebkitScripts,
});

// read the built file from disk and do replacements
Expand Down
9 changes: 9 additions & 0 deletions injected/integration-test/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ test.describe('Test integration pages', () => {
);
});

test('Element hiding functionality', async ({ page }, testInfo) => {
await testPage(
page,
testInfo,
'/element-hiding/index.html',
'./integration-test/test-pages/element-hiding/config/element-hiding.json',
);
});

test('Web compat shims correctness', async ({ page }, testInfo) => {
// prettier-ignore
await testPage(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"readme": "This config is used to test the element hiding feature functionality.",
"version": 1,
"features": {
"elementHiding": {
"state": "enabled",
"exceptions": [],
"settings": {
"additionalCheck": "enabled",
"useStrictHideStyleTag": true,
"rules": [
{
"selector": ".hide-test",
"type": "hide"
},
{
"selector": ".hide-empty-test",
"type": "hide-empty"
},
{
"selector": ".closest-empty-test",
"type": "closest-empty"
}
],
"hideTimeouts": [0, 100, 300, 500, 1000, 1500, 2000, 3000, 5000],
"unhideTimeouts": [1250, 2250, 3250, 5250],
"mediaAndFormSelectors": "video,canvas,embed,object,audio,map,form,input,textarea,select,option",
"adLabelStrings": [
"ad",
"advert",
"advertisement",
"advertisements",
"advertising",
"sponsor message",
"sponsored",
"close",
"close ad",
"skip ad"
],
"domains": [
{
"domain": "localhost:3000",
"rules": [
{
"selector": "[class^='ad-container']",
"type": "override"
}
]
}
]
}
}
},
"unprotectedTemporary": []
}
Loading
Loading