Skip to content

Commit

Permalink
Add serial mode to playwright setup - login via API (#5032)
Browse files Browse the repository at this point in the history
  • Loading branch information
karola312 authored Jul 8, 2024
1 parent df9ace6 commit 592979a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-ants-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Login via API in order to setup playwright tests is working in serial mode
3 changes: 3 additions & 0 deletions playwright/tests/auth.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import fs from 'fs';
import path from 'path';
import { USER_PERMISSION, UserPermissionType, permissions } from "@data/userPermissions";

setup.describe.configure({ mode: 'serial' });

const authenticateAndSaveState = async (request: APIRequestContext, email: string, password: string, filePath: string) => {

const basicApiService = new BasicApiService(request);
await basicApiService.logInUserViaApi({ email, password });

const loginJsonInfo = await request.storageState();


loginJsonInfo.origins.push({
origin: process.env.BASE_URL!,
localStorage: [
Expand Down

0 comments on commit 592979a

Please sign in to comment.