Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgw96 committed Jan 6, 2024
1 parent 85e31ee commit 0ac94e6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default defineConfig({
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
}
],

/* Folder for test artifacts such as screenshots, videos, traces, etc. */
Expand Down
36 changes: 35 additions & 1 deletion tests/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test('ensure timeline loads on home page', async ({ page }) => {
await expect(page.locator('#sl-tab-panel-1 app-timeline')).toBeVisible();
});

test('ensure that you can switch tabs, such as to the notifications tab', async ({ page }) => {
test('ensure that the notifications tab loads', async ({ page }) => {
await page.evaluate(() => {
localStorage.setItem("server", "https://tech.lgbt");
localStorage.setItem("accessToken", "84oZCLxHFOUEP_rLET5r1FcRvNhGYfWoahtSSq4ZQ6I");
Expand All @@ -61,6 +61,40 @@ test('ensure that you can switch tabs, such as to the notifications tab', async
await expect(page.locator('#sl-tab-panel-7 app-notifications')).toBeVisible();
});

test('ensure that the bookmarks tab loads', async ({ page }) => {
await page.evaluate(() => {
localStorage.setItem("server", "https://tech.lgbt");
localStorage.setItem("accessToken", "84oZCLxHFOUEP_rLET5r1FcRvNhGYfWoahtSSq4ZQ6I");
});

await page.reload();

await page.waitForLoadState('networkidle');

// click the notifications tab
await page.click('sl-tab[panel="bookmarks"]');

// expect the notifications tab to be visible
await expect(page.locator('#sl-tab-panel-5 app-bookmarks')).toBeVisible();
});

test('ensure that the search tab loads', async ({ page }) => {
await page.evaluate(() => {
localStorage.setItem("server", "https://tech.lgbt");
localStorage.setItem("accessToken", "84oZCLxHFOUEP_rLET5r1FcRvNhGYfWoahtSSq4ZQ6I");
});

await page.reload();

await page.waitForLoadState('networkidle');

// click the notifications tab
await page.click('sl-tab[panel="search"]');

// expect the notifications tab to be visible
await expect(page.locator('#sl-tab-panel-8 app-search')).toBeVisible();
});

test('ensure service worker is registered', async ({ page }) => {
test.slow();
// expect the service worker to be registered
Expand Down

0 comments on commit 0ac94e6

Please sign in to comment.