Browse Source

Finally, login

Shun Miyazawa 1 year ago
parent
commit
aa2c26a1a2
1 changed files with 11 additions and 7 deletions
  1. 11 7
      apps/app/playwright/22-sharelink/access-to-sharelink.spec.ts

+ 11 - 7
apps/app/playwright/22-sharelink/access-to-sharelink.spec.ts

@@ -1,5 +1,7 @@
 import { test, expect } from '@playwright/test';
 import { test, expect } from '@playwright/test';
 
 
+import { login } from '../utils/Login';
+
 test.describe.serial('Access to sharelink by guest', () => {
 test.describe.serial('Access to sharelink by guest', () => {
   let createdSharelink: string | null;
   let createdSharelink: string | null;
 
 
@@ -18,16 +20,18 @@ test.describe.serial('Access to sharelink by guest', () => {
   });
   });
 
 
   test('The sharelink page is successfully loaded', async({ page }) => {
   test('The sharelink page is successfully loaded', async({ page }) => {
-    // await page.goto('/');
+    await page.goto('/');
 
 
-    // logout
-    // await page.getByTestId('personal-dropdown-button').click();
-    // await expect(page.getByTestId('logout-button')).toBeVisible();
-    // await page.getByTestId('logout-button').click();
-    // await page.waitForURL('http://localhost:3000/login');
+    // Logout
+    await page.getByTestId('personal-dropdown-button').click();
+    await expect(page.getByTestId('logout-button')).toBeVisible();
+    await page.getByTestId('logout-button').click();
+    await page.waitForURL('http://localhost:3000/login');
 
 
-    // access sharelink
+    // Access sharelink
     await page.goto(`/share/${createdSharelink}`);
     await page.goto(`/share/${createdSharelink}`);
     await expect(page.locator('.page-meta')).toBeVisible();
     await expect(page.locator('.page-meta')).toBeVisible();
+
+    await login(page);
   });
   });
 });
 });