Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ test.describe('newtab favorites', () => {
const ntp = NewtabPage.create(page, workerInfo);
const favorites = new FavoritesPage(ntp);
await ntp.reducedMotion();
await ntp.openPage();
await ntp.openPage({ additional: { omnibar: 'false' } });
await favorites.tabsThroughItems();
});
test('initial empty state', async ({ page }, workerInfo) => {
const ntp = NewtabPage.create(page, workerInfo);
const favorites = new FavoritesPage(ntp);
await ntp.reducedMotion();
// Use cpm: 'null' to enable new UI with InfoIcon for tab navigation test
await ntp.openPage({ favorites: 0, additional: { cpm: 'null' } });
// Use omnibar: 'false' to hide omnibar so tab order is predictable
await ntp.openPage({ favorites: 0, additional: { cpm: 'null', omnibar: 'false' } });
await favorites.tabsPastEmptyFavorites();
});
test('re-orders items', async ({ page }, workerInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion special-pages/pages/new-tab/app/mock-transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ export function initialSetup(url) {
widgetsFromStorage.push({ id: 'protections' });
widgetConfigFromStorage.push({ id: 'protections', visibility: 'visible' });

if (url.searchParams.has('omnibar')) {
if (url.searchParams.get('omnibar') !== 'false') {
const favoritesWidgetIndex = widgetsFromStorage.findIndex((widget) => widget.id === 'favorites') ?? 0;
widgetsFromStorage.splice(favoritesWidgetIndex, 0, { id: 'omnibar' });
const favoritesWidgetConfigIndex = widgetConfigFromStorage.findIndex((widget) => widget.id === 'favorites') ?? 0;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ export class NewtabPage {
}

for (const [key, value] of Object.entries(additional || {})) {
searchParams.set(key, value);
if (Array.isArray(value)) {
for (const item of value) {
searchParams.append(key, item);
}
} else {
searchParams.set(key, value);
}
}

// eslint-disable-next-line no-undef
Expand Down

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test.describe('newtab widgets', () => {
context: 'specialPages',
featureName: 'newTabPage',
params: [
{ id: 'omnibar', visibility: 'visible' },
{ id: 'favorites', visibility: 'visible' },
{ id: 'protections', visibility: 'hidden' },
],
Expand Down Expand Up @@ -60,6 +61,7 @@ test.describe('newtab widgets', () => {
context: 'specialPages',
featureName: 'newTabPage',
params: [
{ id: 'omnibar', visibility: 'visible' },
{ id: 'favorites', visibility: 'visible' },
{ id: 'protections', visibility: 'visible' },
],
Expand All @@ -85,6 +87,10 @@ test.describe('newtab widgets', () => {
method: 'contextMenu',
params: {
visibilityMenuItems: [
{
id: 'omnibar',
title: 'Search',
},
{
id: 'favorites',
title: 'Favorites',
Expand Down
23 changes: 22 additions & 1 deletion special-pages/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default defineConfig({
'freemium-pir-banner.spec.js',
'subscription-winback-banner.spec.js',
'new-tab.spec.js',
'new-tab.screenshots.spec.js',
'next-steps.spec.js',
'privacy-stats.spec.js',
'rmf.spec.js',
Expand All @@ -49,6 +48,28 @@ export default defineConfig({
platform: 'windows',
},
},
{
name: 'ntp-screenshots-light',
testMatch: ['new-tab.screenshots.spec.js'],
use: {
...devices['Desktop Chrome'],
injectName: 'integration',
platform: 'windows',
colorScheme: 'light',
viewport: { width: 1000, height: 1500 },
},
},
{
name: 'ntp-screenshots-dark',
testMatch: ['new-tab.screenshots.spec.js'],
use: {
...devices['Desktop Chrome'],
injectName: 'integration',
platform: 'windows',
colorScheme: 'dark',
viewport: { width: 1000, height: 1500 },
},
},
{
name: 'macos',
testMatch: [
Expand Down
Loading