@umbraco/playwright-testhelpers 17.0.0-beta.10 → 17.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,36 +88,35 @@ export declare class ApiHelpers {
88
88
  delete(url: string, data?: object): Promise<import("playwright-core").APIResponse>;
89
89
  put(url: string, data?: object): Promise<import("playwright-core").APIResponse>;
90
90
  postMultiPartForm(url: string, id: any, name: string, mimeType: string, filePath: any): Promise<import("playwright-core").APIResponse>;
91
- private getTokenIssuedTime;
92
- private getTokenExpireTime;
93
91
  getRefreshToken(): Promise<any>;
94
- isAccessTokenValid(): Promise<void | {
92
+ refreshLoginState(userEmail: string, userPassword: string): Promise<{
95
93
  cookie: string;
96
- accessToken: any;
97
- refreshToken: any;
98
- }>;
99
- private currentDateToEpoch;
100
- private dateToEpoch;
101
- refreshAccessToken(userEmail: string, userPassword: string): Promise<void | {
102
- cookie: string;
103
- accessToken: any;
104
- refreshToken: any;
105
- }>;
94
+ accessToken: string;
95
+ refreshToken: string;
96
+ } | undefined>;
97
+ private splitCookies;
106
98
  updateTokenAndCookie(userEmail: string, userPassword: string): Promise<{
107
99
  cookie: string;
108
- accessToken: any;
109
- refreshToken: any;
100
+ accessToken: string;
101
+ refreshToken: string;
110
102
  }>;
111
103
  readFileContent(filePath: any): Promise<any>;
112
104
  readLocalBearerToken(): Promise<string>;
113
105
  readLocalCookie(): Promise<string>;
114
106
  private getLocalStorageToken;
107
+ extractTokensFromSetCookie(setCookies: string): Promise<{
108
+ accessToken: string;
109
+ refreshToken: string;
110
+ }>;
115
111
  private getLocalStorageAuthToken;
116
- private updateLocalStorage;
117
112
  private updateCookie;
118
113
  revokeAccessToken(cookie: string, accessToken: string): Promise<import("playwright-core").APIResponse>;
119
114
  revokeRefreshToken(cookie: string, refreshToken: string): Promise<import("playwright-core").APIResponse>;
120
- loginToAdminUser(testUserCookie: string, testUserAccessToken: string, testUserRefreshToken: string): Promise<void>;
115
+ loginToAdminUser(testUserCookie: string, testUserAccessToken: string, testUserRefreshToken: string): Promise<{
116
+ cookie: string;
117
+ accessToken: string;
118
+ refreshToken: string;
119
+ }>;
121
120
  getCurrentTimePlusMinute(minute?: number): Promise<string>;
122
121
  convertDateFormat(dateString: string): Promise<string>;
123
122
  }
@@ -187,44 +187,48 @@ class ApiHelpers {
187
187
  };
188
188
  return await this.page.request.post(url, options);
189
189
  }
190
- async getTokenIssuedTime() {
191
- const authToken = await this.getLocalStorageAuthToken();
192
- return Number(authToken.issued_at);
193
- }
194
- async getTokenExpireTime() {
195
- const authToken = await this.getLocalStorageAuthToken();
196
- return Number(authToken.expires_in);
197
- }
190
+ // Currently not used
191
+ // private async getTokenIssuedTime() {
192
+ // const authToken = await this.getLocalStorageAuthToken();
193
+ // return Number(authToken.issued_at);
194
+ // }
195
+ // private async getTokenExpireTime() {
196
+ // const authToken = await this.getLocalStorageAuthToken();
197
+ // return Number(authToken.expires_in);
198
+ // }
199
+ //
200
+ // async isAccessTokenValid() {
201
+ // const tokenTimeIssued = await this.getTokenIssuedTime();
202
+ // const tokenExpireTime = await this.getTokenExpireTime();
203
+ // // Should use a global value
204
+ // const globalTestTimeout: number = 45;
205
+ // // We want to have the date minus the globalTimeout, the reason for this is that while a test is running, the token could expire.
206
+ // // The refresh token lasts for 300 seconds, while the access token lasts for 60 seconds (NOT TOTALLY SURE) this is why we add 240 seconds
207
+ // const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout);
208
+ // // We need the currentTimeInEpoch so we can check if the tokenRefreshTime is close to expiring.
209
+ // const currentTimeInEpoch = await this.currentDateToEpoch();
210
+ //
211
+ // if (tokenRefreshTime <= currentTimeInEpoch) {
212
+ // return await this.refreshAccessToken(umbracoConfig.user.login, umbracoConfig.user.password);
213
+ // }
214
+ // }
198
215
  async getRefreshToken() {
199
216
  const authToken = await this.getLocalStorageAuthToken();
200
217
  return authToken.refresh_token;
201
218
  }
202
- async isAccessTokenValid() {
203
- const tokenTimeIssued = await this.getTokenIssuedTime();
204
- const tokenExpireTime = await this.getTokenExpireTime();
205
- // Should use a global value
206
- const globalTestTimeout = 45;
207
- // We want to have the date minus the globalTimeout, the reason for this is that while a test is running, the token could expire.
208
- // The refresh token lasts for 300 seconds, while the access token lasts for 60 seconds (NOT TOTALLY SURE) this is why we add 240 seconds
209
- const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout);
210
- // We need the currentTimeInEpoch so we can check if the tokenRefreshTime is close to expiring.
211
- const currentTimeInEpoch = await this.currentDateToEpoch();
212
- if (tokenRefreshTime <= currentTimeInEpoch) {
213
- return await this.refreshAccessToken(umbraco_config_1.umbracoConfig.user.login, umbraco_config_1.umbracoConfig.user.password);
214
- }
215
- }
216
- async currentDateToEpoch() {
217
- const currentTime = new Date(Date.now());
218
- return await this.dateToEpoch(currentTime);
219
- }
220
- async dateToEpoch(date) {
221
- const dateToEpoch = date.getTime();
222
- // The epoch is in milliseconds, but we want it to be in seconds(Like it is in the token).
223
- const millisecondsToSeconds = dateToEpoch / 1000;
224
- // There is no need to have anything after .
225
- return Number(millisecondsToSeconds.toString().split('.')[0]);
226
- }
227
- async refreshAccessToken(userEmail, userPassword) {
219
+ // private async currentDateToEpoch() {
220
+ // const currentTime = new Date(Date.now());
221
+ // return await this.dateToEpoch(currentTime);
222
+ // }
223
+ //
224
+ // private async dateToEpoch(date: Date) {
225
+ // const dateToEpoch = date.getTime();
226
+ // // The epoch is in milliseconds, but we want it to be in seconds(Like it is in the token).
227
+ // const millisecondsToSeconds = dateToEpoch / 1000;
228
+ // // There is no need to have anything after .
229
+ // return Number(millisecondsToSeconds.toString().split('.')[0]);
230
+ // }
231
+ async refreshLoginState(userEmail, userPassword) {
228
232
  const response = await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {
229
233
  headers: {
230
234
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -240,20 +244,37 @@ class ApiHelpers {
240
244
  ignoreHTTPSErrors: true
241
245
  });
242
246
  if (response.status() === 200) {
243
- const jsonStorageValue = await response.json();
244
- return await this.updateLocalStorage(jsonStorageValue);
247
+ const jsonStorageCookie = response.headers()['set-cookie'];
248
+ // We get multiple cookies, so we have to split them and then update each of the cookies in our localstorage
249
+ let cookies = this.splitCookies(jsonStorageCookie);
250
+ for (const cookie of cookies) {
251
+ await this.updateCookie(cookie);
252
+ }
253
+ return;
245
254
  }
246
255
  console.log('Error refreshing access token.');
247
256
  return await this.updateTokenAndCookie(userEmail, userPassword);
248
257
  }
258
+ splitCookies(cookieString) {
259
+ return cookieString
260
+ .trim()
261
+ .split('\n')
262
+ .filter(line => line.trim())
263
+ .filter(line => !line.includes('expires=Thu, 01 Jan 1970'));
264
+ }
249
265
  async updateTokenAndCookie(userEmail, userPassword) {
250
266
  const storageStateValues = await this.login.login(userEmail, userPassword);
251
267
  await this.updateCookie(storageStateValues.cookie);
252
- await this.updateLocalStorage(storageStateValues.accessToken);
268
+ // We get multiple set cookies, so we have to split them and then update each of the cookies in our localstorage
269
+ let cookies = this.splitCookies(storageStateValues.setCookies);
270
+ for (const cookie of cookies) {
271
+ await this.updateCookie(cookie);
272
+ }
273
+ let tokens = await this.extractTokensFromSetCookie(storageStateValues.setCookies);
253
274
  return {
254
275
  cookie: storageStateValues.cookie,
255
- accessToken: storageStateValues.accessToken.access_token,
256
- refreshToken: storageStateValues.refreshToken.refresh_token
276
+ accessToken: tokens.accessToken,
277
+ refreshToken: tokens.refreshToken,
257
278
  };
258
279
  }
259
280
  async readFileContent(filePath) {
@@ -299,67 +320,58 @@ class ApiHelpers {
299
320
  async getLocalStorageToken(localStorage, tokenName) {
300
321
  return await localStorage.origins?.[0]?.localStorage?.find(item => item.name === tokenName);
301
322
  }
323
+ async extractTokensFromSetCookie(setCookies) {
324
+ // Extract token values from cookies
325
+ const accessToken = setCookies.match(/__Host-umbAccessToken=([^;]+)/)?.[1] ?? "";
326
+ const refreshToken = setCookies.match(/__Host-umbRefreshToken=([^;]+)/)?.[1] ?? "";
327
+ return { accessToken, refreshToken };
328
+ }
302
329
  async getLocalStorageAuthToken() {
303
330
  const currentStorageState = await this.page.context().storageState();
304
331
  const currentStorageToken = await this.getLocalStorageToken(currentStorageState, 'umb:userAuthTokenResponse');
305
332
  return JSON.parse(currentStorageToken.value);
306
333
  }
307
- async updateLocalStorage(localStorageValue) {
308
- // Parse the existing token value and update its fields
309
- let currentLocalStorageValue = await this.getLocalStorageAuthToken();
310
- const newIssuedTime = await this.currentDateToEpoch();
311
- currentLocalStorageValue.access_token = localStorageValue.access_token;
312
- currentLocalStorageValue.refresh_token = localStorageValue.refresh_token;
313
- currentLocalStorageValue.issued_at = newIssuedTime;
314
- currentLocalStorageValue.scope = localStorageValue.scope;
315
- currentLocalStorageValue.token_type = localStorageValue.token_type;
316
- currentLocalStorageValue.expires_in = localStorageValue.expires_in.toString();
317
- const filePath = process.env.STORAGE_STAGE_PATH;
318
- // Updates the user.json file in our CMS project
319
- if (filePath) {
320
- try {
321
- const data = await this.readFileContent(filePath);
322
- const fileLocalStorageToken = await this.getLocalStorageToken(data, 'umb:userAuthTokenResponse');
323
- fileLocalStorageToken.value = JSON.stringify(currentLocalStorageValue);
324
- // Converts the object to JSON string
325
- const updatedJsonString = JSON.stringify(data, null, 2);
326
- // Writes the updated JSON content to the file
327
- fs.writeFileSync(filePath, updatedJsonString, 'utf-8');
328
- }
329
- catch (error) {
330
- console.error('Error updating token:', error);
331
- }
332
- }
333
- }
334
334
  async updateCookie(cookieString) {
335
- const currentStorageState = await this.page.context().storageState();
336
- let currentCookie = currentStorageState.cookies[0];
337
- const parts = cookieString.split(';').map(part => part.trim());
338
- // Extract the main key-value pair
339
- const [nameValue, ...attributes] = parts;
340
- const [, value] = nameValue.split('=');
341
- // Updates the cookie value
342
- currentCookie.value = value;
343
- // Process each attribute
344
- for (const attr of attributes) {
345
- const [key, val] = attr.split('=');
346
- if (key.trim().toLowerCase() === 'expires') {
347
- // Updates the expires value and converts it to Epoch
348
- currentCookie.expires = await this.dateToEpoch(new Date(val));
335
+ try {
336
+ // Parse cookie string
337
+ const parts = cookieString.split(';').map(p => p.trim());
338
+ const [nameValue, ...attributes] = parts;
339
+ const [name, value] = nameValue.split('=');
340
+ const cookieName = name.trim();
341
+ // Get current state
342
+ const storageState = await this.page.context().storageState();
343
+ const cookieIndex = storageState.cookies.findIndex(c => c.name === cookieName);
344
+ if (cookieIndex === -1) {
345
+ console.log(`Cookie "${cookieName}" not found`);
346
+ return;
349
347
  }
350
- }
351
- const filePath = process.env.STORAGE_STAGE_PATH;
352
- if (filePath) {
353
- try {
354
- const data = await this.readFileContent(filePath);
355
- data.cookies[0] = currentCookie;
356
- const updatedJsonString = JSON.stringify(data, null, 2);
357
- fs.writeFileSync(filePath, updatedJsonString, 'utf-8');
348
+ // Update cookie value
349
+ storageState.cookies[cookieIndex].value = value;
350
+ // Update expires if present
351
+ for (const attr of attributes) {
352
+ if (attr.toLowerCase().startsWith('expires=')) {
353
+ const expiresDate = attr.split('=')[1];
354
+ storageState.cookies[cookieIndex].expires = Date.parse(expiresDate) / 1000;
355
+ }
358
356
  }
359
- catch (error) {
360
- console.error('Error updating cookie:', error);
357
+ // Write to file if path exists
358
+ const filePath = process.env.STORAGE_STAGE_PATH;
359
+ if (filePath) {
360
+ const fs = require('fs');
361
+ const fileData = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
362
+ const fileCookieIndex = fileData.cookies.findIndex(c => c.name === cookieName);
363
+ if (fileCookieIndex !== -1) {
364
+ fileData.cookies[fileCookieIndex] = storageState.cookies[cookieIndex];
365
+ fs.writeFileSync(filePath, JSON.stringify(fileData, null, 2));
366
+ }
367
+ else {
368
+ console.log(`Cookie "${cookieName}" not found in file`);
369
+ }
361
370
  }
362
371
  }
372
+ catch (error) {
373
+ console.error('Error updating cookie:', error);
374
+ }
363
375
  }
364
376
  async revokeAccessToken(cookie, accessToken) {
365
377
  return await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/revoke', {
@@ -394,7 +406,9 @@ class ApiHelpers {
394
406
  async loginToAdminUser(testUserCookie, testUserAccessToken, testUserRefreshToken) {
395
407
  await this.revokeAccessToken(testUserCookie, testUserAccessToken);
396
408
  await this.revokeRefreshToken(testUserCookie, testUserRefreshToken);
397
- await this.updateTokenAndCookie(umbraco_config_1.umbracoConfig.user.login, umbraco_config_1.umbracoConfig.user.password);
409
+ let userCookieAndTokens;
410
+ userCookieAndTokens = await this.updateTokenAndCookie(umbraco_config_1.umbracoConfig.user.login, umbraco_config_1.umbracoConfig.user.password);
411
+ return userCookieAndTokens;
398
412
  }
399
413
  async getCurrentTimePlusMinute(minute = 1) {
400
414
  const now = new Date();
@@ -1 +1 @@
1
- {"version":3,"file":"ApiHelpers.js","sourceRoot":"","sources":["../../../lib/helpers/ApiHelpers.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AACnD,iDAA4C;AAC5C,qEAAgE;AAChE,2DAAsD;AACtD,+DAA0D;AAC1D,mEAA8D;AAC9D,6DAAwD;AACxD,2DAAsD;AACtD,+CAA0C;AAC1C,2DAAsD;AACtD,mDAA8C;AAC9C,qEAAgE;AAChE,yDAAoD;AACpD,uDAAkD;AAClD,iEAA4D;AAC5D,+DAA0D;AAC1D,yBAAyB;AACzB,6DAAwD;AACxD,mEAA8D;AAC9D,2DAAsD;AACtD,6DAAwD;AACxD,qDAAgD;AAChD,iEAA4D;AAC5D,qEAAgE;AAChE,iEAA4D;AAC5D,yDAAoD;AACpD,uEAAkE;AAClE,+EAA0E;AAC1E,iEAA4D;AAC5D,uDAAkD;AAClD,+DAA0D;AAC1D,6EAAwE;AACxE,qDAAgD;AAChD,yDAAoD;AACpD,iGAA4F;AAC5F,qGAAgG;AAEhG,MAAa,UAAU;IACrB,OAAO,GAAW,8BAAa,CAAC,WAAW,CAAC,OAAO,CAAC;IACpD,IAAI,CAAO;IACX,KAAK,CAAc;IACnB,MAAM,CAAe;IACrB,SAAS,CAAyB;IAClC,QAAQ,CAAoB;IAC5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,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,UAAkB;QACvC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;YACnD,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAAM;YACb,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;IACL,CAAC;CACF;AApaD,gCAoaC","sourcesContent":["import {Page} from \"@playwright/test\"\nimport {umbracoConfig} from \"../../umbraco.config\";\nimport {ReportHelper} from \"./ReportHelper\";\nimport {TelemetryDataApiHelper} from \"./TelemetryDataApiHelper\";\nimport {LanguageApiHelper} from \"./LanguageApiHelper\";\nimport {DictionaryApiHelper} from \"./DictionaryApiHelper\";\nimport {RelationTypeApiHelper} from \"./RelationTypeApiHelper\";\nimport {UserGroupApiHelper} from \"./UserGroupApiHelper\";\nimport {TemplateApiHelper} from \"./TemplateApiHelper\";\nimport {AliasHelper} from \"./AliasHelper\";\nimport {DataTypeApiHelper} from \"./DataTypeApiHelper\";\nimport {UserApiHelper} from \"./UserApiHelper\";\nimport {TemporaryFileApiHelper} from \"./TemporaryFileApiHelper\";\nimport {PackageApiHelper} from \"./PackageApiHelper\";\nimport {ScriptApiHelper} from \"./ScriptApiHelper\";\nimport {PartialViewApiHelper} from \"./PartialViewApiHelper\";\nimport {StylesheetApiHelper} from \"./StylesheetApiHelper\";\nimport * as fs from \"fs\";\nimport {LogViewerApiHelper} from \"./LogViewerApiHelper\";\nimport {DocumentTypeApiHelper} from \"./DocumentTypeApiHelper\";\nimport {DocumentApiHelper} from \"./DocumentApiHelper\";\nimport {MediaTypeApiHelper} from \"./MediaTypeApiHelper\";\nimport {MediaApiHelper} from \"./MediaApiHelper\";\nimport {ObjectTypesApiHelper} from \"./ObjectTypesApiHelper\";\nimport {ModelsBuilderApiHelper} from \"./ModelsBuilderApiHelper\";\nimport {HealthCheckApiHelper} from \"./HealthCheckApiHelper\";\nimport {IndexerApiHelper} from \"./IndexerApiHelper\";\nimport {PublishedCacheApiHelper} from \"./PublishedCacheApiHelper\";\nimport {RedirectManagementApiHelper} from './RedirectManagementApiHelper';\nimport {MemberGroupApiHelper} from './MemberGroupApiHelper';\nimport {MemberApiHelper} from './MemberApiHelper';\nimport {MemberTypeApiHelper} from \"./MemberTypeApiHelper\";\nimport {DocumentBlueprintApiHelper} from \"./DocumentBlueprintApiHelper\";\nimport {LoginApiHelper} from \"./LoginApiHelper\";\nimport {WebhookApiHelper} from \"./WebhookApiHelper\";\nimport {MediaDeliveryApiHelper} from './differentAppSettingsHelpers/MediaDeliveryApiHelper';\nimport {ContentDeliveryApiHelper} from \"./differentAppSettingsHelpers/ContentDeliveryApiHelper\";\n\nexport class ApiHelpers {\n baseUrl: string = umbracoConfig.environment.baseUrl;\n page: Page;\n alias: AliasHelper;\n report: ReportHelper;\n telemetry: TelemetryDataApiHelper;\n language: LanguageApiHelper;\n dictionary: DictionaryApiHelper;\n relationType: RelationTypeApiHelper;\n userGroup: UserGroupApiHelper;\n template: TemplateApiHelper;\n dataType: DataTypeApiHelper;\n user: UserApiHelper;\n temporaryFile: TemporaryFileApiHelper;\n documentType: DocumentTypeApiHelper;\n document: DocumentApiHelper;\n package: PackageApiHelper;\n script: ScriptApiHelper;\n partialView: PartialViewApiHelper;\n stylesheet: StylesheetApiHelper;\n logViewer: LogViewerApiHelper;\n mediaType: MediaTypeApiHelper;\n media: MediaApiHelper;\n objectTypes: ObjectTypesApiHelper;\n modelsBuilder: ModelsBuilderApiHelper;\n healthCheck: HealthCheckApiHelper;\n indexer: IndexerApiHelper;\n publishedCache: PublishedCacheApiHelper;\n redirectManagement: RedirectManagementApiHelper;\n memberGroup: MemberGroupApiHelper;\n member: MemberApiHelper;\n memberType: MemberTypeApiHelper;\n documentBlueprint: DocumentBlueprintApiHelper;\n login: LoginApiHelper;\n webhook: WebhookApiHelper;\n mediaDeliveryApi: MediaDeliveryApiHelper;\n contentDeliveryApi: ContentDeliveryApiHelper;\n\n constructor(page: Page) {\n this.page = page;\n this.alias = new AliasHelper();\n this.report = new ReportHelper(this);\n this.telemetry = new TelemetryDataApiHelper(this);\n this.language = new LanguageApiHelper(this);\n this.dictionary = new DictionaryApiHelper(this);\n this.relationType = new RelationTypeApiHelper(this);\n this.userGroup = new UserGroupApiHelper(this);\n this.template = new TemplateApiHelper(this);\n this.dataType = new DataTypeApiHelper(this);\n this.user = new UserApiHelper(this, page);\n this.temporaryFile = new TemporaryFileApiHelper(this);\n this.documentType = new DocumentTypeApiHelper(this);\n this.document = new DocumentApiHelper(this);\n this.package = new PackageApiHelper(this);\n this.script = new ScriptApiHelper(this);\n this.partialView = new PartialViewApiHelper(this);\n this.stylesheet = new StylesheetApiHelper(this);\n this.logViewer = new LogViewerApiHelper(this);\n this.mediaType = new MediaTypeApiHelper(this);\n this.media = new MediaApiHelper(this);\n this.objectTypes = new ObjectTypesApiHelper(this);\n this.modelsBuilder = new ModelsBuilderApiHelper(this);\n this.healthCheck = new HealthCheckApiHelper(this);\n this.indexer = new IndexerApiHelper(this);\n this.publishedCache = new PublishedCacheApiHelper(this);\n this.redirectManagement = new RedirectManagementApiHelper(this);\n this.memberGroup = new MemberGroupApiHelper(this);\n this.member = new MemberApiHelper(this);\n this.memberType = new MemberTypeApiHelper(this);\n this.documentBlueprint = new DocumentBlueprintApiHelper(this);\n this.login = new LoginApiHelper(this, this.page);\n this.webhook = new WebhookApiHelper(this, this.page);\n this.mediaDeliveryApi = new MediaDeliveryApiHelper(this);\n this.contentDeliveryApi = new ContentDeliveryApiHelper(this);\n }\n\n async getAccessToken() {\n const authToken = await this.getLocalStorageAuthToken();\n return authToken.access_token;\n }\n\n async getBearerToken() {\n return 'Bearer ' + await this.getAccessToken();\n }\n\n async getCookie() {\n let someStorage = await this.page.context().storageState();\n let cookieString = \"\";\n for (let cookie of someStorage.cookies) {\n cookieString += cookie.name + '=' + cookie.value + ';';\n }\n return cookieString;\n }\n\n async getHeaders() {\n return {\n 'Authorization': await this.readLocalBearerToken(),\n 'Cookie': await this.readLocalCookie(),\n }\n }\n\n async get(url: string, params?: { [key: string]: string | number | boolean; }, extraHeaders?: { [key: string]: string; }) {\n const headers = await this.getHeaders();\n const allHeaders = { ...headers, ...extraHeaders };\n const options = {\n headers: allHeaders,\n params: params,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.get(url, options);\n }\n\n async saveCodeFile(codeFile) {\n if (codeFile == null) {\n return;\n }\n return await this.post(umbracoConfig.environment.baseUrl + '/umbraco/backoffice/UmbracoApi/CodeFile/PostSave', codeFile);\n }\n\n async post(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.post(url, options);\n }\n\n async delete(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.delete(url, options);\n }\n\n async put(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.put(url, options);\n }\n\n async postMultiPartForm(url: string, id, name: string, mimeType: string, filePath) {\n const options = {\n headers: await this.getHeaders(),\n multipart: {\n Id: id,\n File: {\n name: name,\n mimeType: mimeType,\n buffer: fs.readFileSync(filePath)\n }\n },\n ignoreHTTPSErrors: true\n }\n return await this.page.request.post(url, options);\n }\n\n private async getTokenIssuedTime() {\n const authToken = await this.getLocalStorageAuthToken();\n return Number(authToken.issued_at);\n }\n\n private async getTokenExpireTime() {\n const authToken = await this.getLocalStorageAuthToken();\n return Number(authToken.expires_in);\n }\n\n async getRefreshToken() {\n const authToken = await this.getLocalStorageAuthToken();\n return authToken.refresh_token;\n }\n\n async isAccessTokenValid() {\n const tokenTimeIssued = await this.getTokenIssuedTime();\n const tokenExpireTime = await this.getTokenExpireTime();\n // Should use a global value\n const globalTestTimeout: number = 45;\n // We want to have the date minus the globalTimeout, the reason for this is that while a test is running, the token could expire.\n // The refresh token lasts for 300 seconds, while the access token lasts for 60 seconds (NOT TOTALLY SURE) this is why we add 240 seconds\n const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout);\n // We need the currentTimeInEpoch so we can check if the tokenRefreshTime is close to expiring.\n const currentTimeInEpoch = await this.currentDateToEpoch();\n\n if (tokenRefreshTime <= currentTimeInEpoch) {\n return await this.refreshAccessToken(umbracoConfig.user.login, umbracoConfig.user.password);\n }\n }\n\n private async currentDateToEpoch() {\n const currentTime = new Date(Date.now());\n return await this.dateToEpoch(currentTime);\n }\n\n private async dateToEpoch(date: Date) {\n const dateToEpoch = date.getTime();\n // The epoch is in milliseconds, but we want it to be in seconds(Like it is in the token).\n const millisecondsToSeconds = dateToEpoch / 1000;\n // There is no need to have anything after .\n return Number(millisecondsToSeconds.toString().split('.')[0]);\n }\n\n async refreshAccessToken(userEmail: string, userPassword: string) {\n const response = await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: await this.readLocalCookie(),\n Origin: this.baseUrl\n },\n form:\n {\n grant_type: 'refresh_token',\n client_id: 'umbraco-back-office',\n redirect_uri: this.baseUrl + '/umbraco/oauth_complete',\n refresh_token: await this.getRefreshToken()\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() === 200) {\n const jsonStorageValue = await response.json();\n return await this.updateLocalStorage(jsonStorageValue);\n }\n console.log('Error refreshing access token.');\n return await this.updateTokenAndCookie(userEmail, userPassword);\n }\n\n async updateTokenAndCookie(userEmail: string, userPassword: string) {\n const storageStateValues = await this.login.login(userEmail, userPassword);\n await this.updateCookie(storageStateValues.cookie);\n await this.updateLocalStorage(storageStateValues.accessToken);\n return {\n cookie: storageStateValues.cookie,\n accessToken: storageStateValues.accessToken.access_token,\n refreshToken: storageStateValues.refreshToken.refresh_token\n };\n }\n\n async readFileContent(filePath) {\n try {\n const jsonString = fs.readFileSync(filePath, 'utf-8');\n return JSON.parse(jsonString);\n } catch (error) {\n console.log('Error reading file:', error);\n throw error;\n }\n }\n\n async readLocalBearerToken() {\n const filePath = process.env.STORAGE_STAGE_PATH;\n if (!filePath) {\n return await this.getBearerToken();\n }\n\n try {\n const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n const localStorageItem = await this.getLocalStorageToken(data, 'umb:userAuthTokenResponse');\n const parsedValue = await JSON.parse(localStorageItem.value);\n return `Bearer ${parsedValue.access_token}`;\n } catch {\n // If the file is not found, return the current access token from the page context\n return await this.getBearerToken();\n }\n }\n\n async readLocalCookie() {\n const filePath = process.env.STORAGE_STAGE_PATH;\n if (!filePath) {\n return await this.getCookie();\n }\n\n try {\n const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n return await data.cookies.map(cookie => `${cookie.name}=${cookie.value}`).join('; ') + ';';\n } catch {\n // If the file is not found, return the current cookie from the page context\n return await this.getCookie();\n }\n }\n\n private async getLocalStorageToken(localStorage: any, tokenName: string) {\n return await localStorage.origins?.[0]?.localStorage?.find(item => item.name === tokenName);\n }\n\n private async getLocalStorageAuthToken(){\n const currentStorageState = await this.page.context().storageState();\n const currentStorageToken = await this.getLocalStorageToken(currentStorageState, 'umb:userAuthTokenResponse');\n return JSON.parse(currentStorageToken.value);\n }\n\n private async updateLocalStorage(localStorageValue) {\n // Parse the existing token value and update its fields\n let currentLocalStorageValue = await this.getLocalStorageAuthToken();\n const newIssuedTime = await this.currentDateToEpoch();\n\n currentLocalStorageValue.access_token = localStorageValue.access_token;\n currentLocalStorageValue.refresh_token = localStorageValue.refresh_token;\n currentLocalStorageValue.issued_at = newIssuedTime;\n currentLocalStorageValue.scope = localStorageValue.scope;\n currentLocalStorageValue.token_type = localStorageValue.token_type;\n currentLocalStorageValue.expires_in = localStorageValue.expires_in.toString();\n\n const filePath = process.env.STORAGE_STAGE_PATH;\n // Updates the user.json file in our CMS project\n if (filePath) {\n try {\n const data = await this.readFileContent(filePath);\n const fileLocalStorageToken = await this.getLocalStorageToken(data, 'umb:userAuthTokenResponse');\n fileLocalStorageToken.value = JSON.stringify(currentLocalStorageValue);\n // Converts the object to JSON string\n const updatedJsonString = JSON.stringify(data, null, 2);\n // Writes the updated JSON content to the file\n fs.writeFileSync(filePath, updatedJsonString, 'utf-8');\n } catch (error) {\n console.error('Error updating token:', error);\n }\n }\n }\n\n private async updateCookie(cookieString: string) {\n const currentStorageState = await this.page.context().storageState();\n let currentCookie = currentStorageState.cookies[0];\n\n const parts = cookieString.split(';').map(part => part.trim());\n // Extract the main key-value pair\n const [nameValue, ...attributes] = parts;\n const [, value] = nameValue.split('=');\n // Updates the cookie value\n currentCookie.value = value;\n // Process each attribute\n for (const attr of attributes) {\n const [key, val] = attr.split('=');\n if (key.trim().toLowerCase() === 'expires') {\n // Updates the expires value and converts it to Epoch\n currentCookie.expires = await this.dateToEpoch(new Date(val));\n }\n }\n\n const filePath = process.env.STORAGE_STAGE_PATH;\n\n if (filePath) {\n try {\n const data = await this.readFileContent(filePath);\n data.cookies[0] = currentCookie;\n const updatedJsonString = JSON.stringify(data, null, 2);\n fs.writeFileSync(filePath, updatedJsonString, 'utf-8');\n } catch (error) {\n console.error('Error updating cookie:', error);\n }\n }\n }\n\n async revokeAccessToken(cookie: string, accessToken: string) {\n return await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/revoke', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.baseUrl\n },\n form:\n {\n token: accessToken,\n token_type_hint: 'access_token',\n client_id: 'umbraco-back-office'\n },\n ignoreHTTPSErrors: true\n });\n }\n\n async revokeRefreshToken(cookie: string, refreshToken: string) {\n return await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/revoke', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.baseUrl\n },\n form:\n {\n token: refreshToken,\n token_type_hint: 'refresh_token',\n client_id: 'umbraco-back-office'\n },\n ignoreHTTPSErrors: true\n });\n }\n\n async loginToAdminUser(testUserCookie: string, testUserAccessToken: string, testUserRefreshToken: string) {\n await this.revokeAccessToken(testUserCookie, testUserAccessToken);\n await this.revokeRefreshToken(testUserCookie, testUserRefreshToken);\n await this.updateTokenAndCookie(umbracoConfig.user.login, umbracoConfig.user.password);\n }\n\n async getCurrentTimePlusMinute(minute: number = 1) {\n const now = new Date();\n now.setMinutes(now.getMinutes() + minute); // Add one minute\n\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, '0');\n const day = String(now.getDate()).padStart(2, '0');\n const hours = String(now.getHours()).padStart(2, '0');\n const minutes = String(now.getMinutes()).padStart(2, '0');\n \n return `${year}-${month}-${day}T${hours}:${minutes}`;\n }\n\n async convertDateFormat(dateString: string) {\n return new Date(dateString).toLocaleString(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hour12: true,\n });\n }\n}"]}
1
+ {"version":3,"file":"ApiHelpers.js","sourceRoot":"","sources":["../../../lib/helpers/ApiHelpers.ts"],"names":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,CAAC;QAC/C,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,iBAAiB;QAE5D,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAE1D,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,UAAkB;QACxC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;YAClD,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAAM;YACb,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;IACL,CAAC;CACF;AApbD,gCAobC","sourcesContent":["import {Page} from \"@playwright/test\"\nimport {umbracoConfig} from \"../../umbraco.config\";\nimport {ReportHelper} from \"./ReportHelper\";\nimport {TelemetryDataApiHelper} from \"./TelemetryDataApiHelper\";\nimport {LanguageApiHelper} from \"./LanguageApiHelper\";\nimport {DictionaryApiHelper} from \"./DictionaryApiHelper\";\nimport {RelationTypeApiHelper} from \"./RelationTypeApiHelper\";\nimport {UserGroupApiHelper} from \"./UserGroupApiHelper\";\nimport {TemplateApiHelper} from \"./TemplateApiHelper\";\nimport {AliasHelper} from \"./AliasHelper\";\nimport {DataTypeApiHelper} from \"./DataTypeApiHelper\";\nimport {UserApiHelper} from \"./UserApiHelper\";\nimport {TemporaryFileApiHelper} from \"./TemporaryFileApiHelper\";\nimport {PackageApiHelper} from \"./PackageApiHelper\";\nimport {ScriptApiHelper} from \"./ScriptApiHelper\";\nimport {PartialViewApiHelper} from \"./PartialViewApiHelper\";\nimport {StylesheetApiHelper} from \"./StylesheetApiHelper\";\nimport * as fs from \"fs\";\nimport {LogViewerApiHelper} from \"./LogViewerApiHelper\";\nimport {DocumentTypeApiHelper} from \"./DocumentTypeApiHelper\";\nimport {DocumentApiHelper} from \"./DocumentApiHelper\";\nimport {MediaTypeApiHelper} from \"./MediaTypeApiHelper\";\nimport {MediaApiHelper} from \"./MediaApiHelper\";\nimport {ObjectTypesApiHelper} from \"./ObjectTypesApiHelper\";\nimport {ModelsBuilderApiHelper} from \"./ModelsBuilderApiHelper\";\nimport {HealthCheckApiHelper} from \"./HealthCheckApiHelper\";\nimport {IndexerApiHelper} from \"./IndexerApiHelper\";\nimport {PublishedCacheApiHelper} from \"./PublishedCacheApiHelper\";\nimport {RedirectManagementApiHelper} from './RedirectManagementApiHelper';\nimport {MemberGroupApiHelper} from './MemberGroupApiHelper';\nimport {MemberApiHelper} from './MemberApiHelper';\nimport {MemberTypeApiHelper} from \"./MemberTypeApiHelper\";\nimport {DocumentBlueprintApiHelper} from \"./DocumentBlueprintApiHelper\";\nimport {LoginApiHelper} from \"./LoginApiHelper\";\nimport {WebhookApiHelper} from \"./WebhookApiHelper\";\nimport {MediaDeliveryApiHelper} from './differentAppSettingsHelpers/MediaDeliveryApiHelper';\nimport {ContentDeliveryApiHelper} from \"./differentAppSettingsHelpers/ContentDeliveryApiHelper\";\n\nexport class ApiHelpers {\n baseUrl: string = umbracoConfig.environment.baseUrl;\n page: Page;\n alias: AliasHelper;\n report: ReportHelper;\n telemetry: TelemetryDataApiHelper;\n language: LanguageApiHelper;\n dictionary: DictionaryApiHelper;\n relationType: RelationTypeApiHelper;\n userGroup: UserGroupApiHelper;\n template: TemplateApiHelper;\n dataType: DataTypeApiHelper;\n user: UserApiHelper;\n temporaryFile: TemporaryFileApiHelper;\n documentType: DocumentTypeApiHelper;\n document: DocumentApiHelper;\n package: PackageApiHelper;\n script: ScriptApiHelper;\n partialView: PartialViewApiHelper;\n stylesheet: StylesheetApiHelper;\n logViewer: LogViewerApiHelper;\n mediaType: MediaTypeApiHelper;\n media: MediaApiHelper;\n objectTypes: ObjectTypesApiHelper;\n modelsBuilder: ModelsBuilderApiHelper;\n healthCheck: HealthCheckApiHelper;\n indexer: IndexerApiHelper;\n publishedCache: PublishedCacheApiHelper;\n redirectManagement: RedirectManagementApiHelper;\n memberGroup: MemberGroupApiHelper;\n member: MemberApiHelper;\n memberType: MemberTypeApiHelper;\n documentBlueprint: DocumentBlueprintApiHelper;\n login: LoginApiHelper;\n webhook: WebhookApiHelper;\n mediaDeliveryApi: MediaDeliveryApiHelper;\n contentDeliveryApi: ContentDeliveryApiHelper;\n\n constructor(page: Page) {\n this.page = page;\n this.alias = new AliasHelper();\n this.report = new ReportHelper(this);\n this.telemetry = new TelemetryDataApiHelper(this);\n this.language = new LanguageApiHelper(this);\n this.dictionary = new DictionaryApiHelper(this);\n this.relationType = new RelationTypeApiHelper(this);\n this.userGroup = new UserGroupApiHelper(this);\n this.template = new TemplateApiHelper(this);\n this.dataType = new DataTypeApiHelper(this);\n this.user = new UserApiHelper(this, page);\n this.temporaryFile = new TemporaryFileApiHelper(this);\n this.documentType = new DocumentTypeApiHelper(this);\n this.document = new DocumentApiHelper(this);\n this.package = new PackageApiHelper(this);\n this.script = new ScriptApiHelper(this);\n this.partialView = new PartialViewApiHelper(this);\n this.stylesheet = new StylesheetApiHelper(this);\n this.logViewer = new LogViewerApiHelper(this);\n this.mediaType = new MediaTypeApiHelper(this);\n this.media = new MediaApiHelper(this);\n this.objectTypes = new ObjectTypesApiHelper(this);\n this.modelsBuilder = new ModelsBuilderApiHelper(this);\n this.healthCheck = new HealthCheckApiHelper(this);\n this.indexer = new IndexerApiHelper(this);\n this.publishedCache = new PublishedCacheApiHelper(this);\n this.redirectManagement = new RedirectManagementApiHelper(this);\n this.memberGroup = new MemberGroupApiHelper(this);\n this.member = new MemberApiHelper(this);\n this.memberType = new MemberTypeApiHelper(this);\n this.documentBlueprint = new DocumentBlueprintApiHelper(this);\n this.login = new LoginApiHelper(this, this.page);\n this.webhook = new WebhookApiHelper(this, this.page);\n this.mediaDeliveryApi = new MediaDeliveryApiHelper(this);\n this.contentDeliveryApi = new ContentDeliveryApiHelper(this);\n }\n\n async getAccessToken() {\n const authToken = await this.getLocalStorageAuthToken();\n return authToken.access_token;\n }\n\n async getBearerToken() {\n return 'Bearer ' + await this.getAccessToken();\n }\n\n async getCookie() {\n let someStorage = await this.page.context().storageState();\n let cookieString = \"\";\n for (let cookie of someStorage.cookies) {\n cookieString += cookie.name + '=' + cookie.value + ';';\n }\n return cookieString;\n }\n\n async getHeaders() {\n return {\n 'Authorization': await this.readLocalBearerToken(),\n 'Cookie': await this.readLocalCookie(),\n }\n }\n\n async get(url: string, params?: { [key: string]: string | number | boolean; }, extraHeaders?: { [key: string]: string; }) {\n const headers = await this.getHeaders();\n const allHeaders = {...headers, ...extraHeaders};\n const options = {\n headers: allHeaders,\n params: params,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.get(url, options);\n }\n\n async saveCodeFile(codeFile) {\n if (codeFile == null) {\n return;\n }\n return await this.post(umbracoConfig.environment.baseUrl + '/umbraco/backoffice/UmbracoApi/CodeFile/PostSave', codeFile);\n }\n\n async post(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.post(url, options);\n }\n\n async delete(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.delete(url, options);\n }\n\n async put(url: string, data?: object) {\n const options = {\n headers: await this.getHeaders(),\n data: data,\n ignoreHTTPSErrors: true\n }\n return await this.page.request.put(url, options);\n }\n\n async postMultiPartForm(url: string, id, name: string, mimeType: string, filePath) {\n const options = {\n headers: await this.getHeaders(),\n multipart: {\n Id: id,\n File: {\n name: name,\n mimeType: mimeType,\n buffer: fs.readFileSync(filePath)\n }\n },\n ignoreHTTPSErrors: true\n }\n return await this.page.request.post(url, options);\n }\n\n // Currently not used\n // private async getTokenIssuedTime() {\n // const authToken = await this.getLocalStorageAuthToken();\n // return Number(authToken.issued_at);\n // }\n // private async getTokenExpireTime() {\n // const authToken = await this.getLocalStorageAuthToken();\n // return Number(authToken.expires_in);\n // }\n //\n // async isAccessTokenValid() {\n // const tokenTimeIssued = await this.getTokenIssuedTime();\n // const tokenExpireTime = await this.getTokenExpireTime();\n // // Should use a global value\n // const globalTestTimeout: number = 45;\n // // We want to have the date minus the globalTimeout, the reason for this is that while a test is running, the token could expire.\n // // The refresh token lasts for 300 seconds, while the access token lasts for 60 seconds (NOT TOTALLY SURE) this is why we add 240 seconds\n // const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout);\n // // We need the currentTimeInEpoch so we can check if the tokenRefreshTime is close to expiring.\n // const currentTimeInEpoch = await this.currentDateToEpoch();\n //\n // if (tokenRefreshTime <= currentTimeInEpoch) {\n // return await this.refreshAccessToken(umbracoConfig.user.login, umbracoConfig.user.password);\n // }\n // }\n async getRefreshToken() {\n const authToken = await this.getLocalStorageAuthToken();\n return authToken.refresh_token;\n }\n\n // private async currentDateToEpoch() {\n // const currentTime = new Date(Date.now());\n // return await this.dateToEpoch(currentTime);\n // }\n //\n // private async dateToEpoch(date: Date) {\n // const dateToEpoch = date.getTime();\n // // The epoch is in milliseconds, but we want it to be in seconds(Like it is in the token).\n // const millisecondsToSeconds = dateToEpoch / 1000;\n // // There is no need to have anything after .\n // return Number(millisecondsToSeconds.toString().split('.')[0]);\n // }\n\n async refreshLoginState(userEmail: string, userPassword: string) {\n const response = await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: await this.readLocalCookie(),\n Origin: this.baseUrl\n },\n form:\n {\n grant_type: 'refresh_token',\n client_id: 'umbraco-back-office',\n redirect_uri: this.baseUrl + '/umbraco/oauth_complete',\n refresh_token: await this.getRefreshToken()\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() === 200) {\n const jsonStorageCookie = response.headers()['set-cookie'];\n // We get multiple cookies, so we have to split them and then update each of the cookies in our localstorage \n let cookies = this.splitCookies(jsonStorageCookie);\n for (const cookie of cookies) {\n await this.updateCookie(cookie);\n }\n return;\n }\n console.log('Error refreshing access token.');\n return await this.updateTokenAndCookie(userEmail, userPassword);\n }\n\n private splitCookies(cookieString: string): string[] {\n return cookieString\n .trim()\n .split('\\n')\n .filter(line => line.trim())\n .filter(line => !line.includes('expires=Thu, 01 Jan 1970'));\n }\n\n async updateTokenAndCookie(userEmail: string, userPassword: string) {\n const storageStateValues = await this.login.login(userEmail, userPassword);\n await this.updateCookie(storageStateValues.cookie)\n\n // We get multiple set cookies, so we have to split them and then update each of the cookies in our localstorage \n let cookies = this.splitCookies(storageStateValues.setCookies);\n for (const cookie of cookies) {\n await this.updateCookie(cookie);\n }\n let tokens = await this.extractTokensFromSetCookie(storageStateValues.setCookies);\n\n return {\n cookie: storageStateValues.cookie,\n accessToken: tokens.accessToken,\n refreshToken: tokens.refreshToken,\n };\n }\n\n async readFileContent(filePath) {\n try {\n const jsonString = fs.readFileSync(filePath, 'utf-8');\n return JSON.parse(jsonString);\n } catch (error) {\n console.log('Error reading file:', error);\n throw error;\n }\n }\n\n async readLocalBearerToken() {\n const filePath = process.env.STORAGE_STAGE_PATH;\n if (!filePath) {\n return await this.getBearerToken();\n }\n\n try {\n const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n const localStorageItem = await this.getLocalStorageToken(data, 'umb:userAuthTokenResponse');\n const parsedValue = await JSON.parse(localStorageItem.value);\n return `Bearer ${parsedValue.access_token}`;\n } catch {\n // If the file is not found, return the current access token from the page context\n return await this.getBearerToken();\n }\n }\n\n async readLocalCookie() {\n const filePath = process.env.STORAGE_STAGE_PATH;\n if (!filePath) {\n return await this.getCookie();\n }\n\n try {\n const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n return await data.cookies.map(cookie => `${cookie.name}=${cookie.value}`).join('; ') + ';';\n } catch {\n // If the file is not found, return the current cookie from the page context\n return await this.getCookie();\n }\n }\n\n private async getLocalStorageToken(localStorage: any, tokenName: string) {\n return await localStorage.origins?.[0]?.localStorage?.find(item => item.name === tokenName);\n }\n\n async extractTokensFromSetCookie(setCookies: string) {\n // Extract token values from cookies\n const accessToken = setCookies.match(/__Host-umbAccessToken=([^;]+)/)?.[1] ?? \"\";\n const refreshToken = setCookies.match(/__Host-umbRefreshToken=([^;]+)/)?.[1] ?? \"\";\n return {accessToken, refreshToken};\n }\n\n private async getLocalStorageAuthToken() {\n const currentStorageState = await this.page.context().storageState();\n const currentStorageToken = await this.getLocalStorageToken(currentStorageState, 'umb:userAuthTokenResponse');\n return JSON.parse(currentStorageToken.value);\n }\n\n private async updateCookie(cookieString: string) {\n try {\n // Parse cookie string\n const parts = cookieString.split(';').map(p => p.trim());\n const [nameValue, ...attributes] = parts;\n const [name, value] = nameValue.split('=');\n const cookieName = name.trim();\n\n // Get current state\n const storageState = await this.page.context().storageState();\n const cookieIndex = storageState.cookies.findIndex(c => c.name === cookieName);\n\n if (cookieIndex === -1) {\n console.log(`Cookie \"${cookieName}\" not found`);\n return;\n }\n\n // Update cookie value\n storageState.cookies[cookieIndex].value = value;\n\n // Update expires if present\n for (const attr of attributes) {\n if (attr.toLowerCase().startsWith('expires=')) {\n const expiresDate = attr.split('=')[1];\n storageState.cookies[cookieIndex].expires = Date.parse(expiresDate) / 1000;\n }\n }\n\n // Write to file if path exists\n const filePath = process.env.STORAGE_STAGE_PATH;\n if (filePath) {\n const fs = require('fs');\n const fileData = JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n\n const fileCookieIndex = fileData.cookies.findIndex(c => c.name === cookieName);\n\n if (fileCookieIndex !== -1) {\n fileData.cookies[fileCookieIndex] = storageState.cookies[cookieIndex];\n fs.writeFileSync(filePath, JSON.stringify(fileData, null, 2));\n } else {\n console.log(`Cookie \"${cookieName}\" not found in file`);\n }\n }\n } catch (error) {\n console.error('Error updating cookie:', error);\n }\n }\n\n async revokeAccessToken(cookie: string, accessToken: string) {\n return await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/revoke', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.baseUrl\n },\n form:\n {\n token: accessToken,\n token_type_hint: 'access_token',\n client_id: 'umbraco-back-office'\n },\n ignoreHTTPSErrors: true\n });\n }\n\n async revokeRefreshToken(cookie: string, refreshToken: string) {\n return await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/revoke', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.baseUrl\n },\n form:\n {\n token: refreshToken,\n token_type_hint: 'refresh_token',\n client_id: 'umbraco-back-office'\n },\n ignoreHTTPSErrors: true\n });\n }\n\n async loginToAdminUser(testUserCookie: string, testUserAccessToken: string, testUserRefreshToken: string) {\n await this.revokeAccessToken(testUserCookie, testUserAccessToken);\n await this.revokeRefreshToken(testUserCookie, testUserRefreshToken);\n \n let userCookieAndTokens: { cookie: string; accessToken: string; refreshToken: string } | undefined;\n userCookieAndTokens = await this.updateTokenAndCookie(umbracoConfig.user.login, umbracoConfig.user.password);\n\n return userCookieAndTokens;\n }\n\n async getCurrentTimePlusMinute(minute: number = 1) {\n const now = new Date();\n now.setMinutes(now.getMinutes() + minute); // Add one minute\n\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, '0');\n const day = String(now.getDate()).padStart(2, '0');\n const hours = String(now.getHours()).padStart(2, '0');\n const minutes = String(now.getMinutes()).padStart(2, '0');\n\n return `${year}-${month}-${day}T${hours}:${minutes}`;\n }\n\n async convertDateFormat(dateString: string) {\n return new Date(dateString).toLocaleString(\"en-US\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hour12: true,\n });\n }\n}"]}
@@ -6,12 +6,11 @@ export declare class LoginApiHelper {
6
6
  constructor(api: ApiHelpers, page: Page);
7
7
  login(userEmail: string, password: string): Promise<{
8
8
  cookie: string;
9
- accessToken: any;
10
- refreshToken: any;
9
+ setCookies: string;
11
10
  }>;
12
11
  getCookie(userEmail: string, password: string): Promise<string>;
13
12
  createCodeChallenge(codeVerifier: string): Promise<string>;
14
13
  getAuthorizationCode(codeChallenge: string, cookie: string, stateValue: string): Promise<string | null>;
15
- getRefreshToken(cookie: string, codeVerifier: string, authorizationCode: any): Promise<any>;
14
+ getCookiesWithAccessTokenAndRefreshToken(cookie: string, codeVerifier: string, authorizationCode: any): Promise<string>;
16
15
  getAccessToken(cookie: string, refreshToken: string): Promise<any>;
17
16
  }
@@ -15,9 +15,8 @@ class LoginApiHelper {
15
15
  const cookie = await this.getCookie(userEmail, password);
16
16
  const codeChallenge = await this.createCodeChallenge(codeVerifier);
17
17
  const authorizationCode = await this.getAuthorizationCode(codeChallenge, cookie, stateValue);
18
- const refreshToken = await this.getRefreshToken(cookie, codeVerifier, authorizationCode);
19
- const accessToken = await this.getAccessToken(cookie, refreshToken.refresh_token);
20
- return { cookie, accessToken, refreshToken };
18
+ const setCookies = await this.getCookiesWithAccessTokenAndRefreshToken(cookie, codeVerifier, authorizationCode);
19
+ return { cookie, setCookies };
21
20
  }
22
21
  async getCookie(userEmail, password) {
23
22
  const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/login', {
@@ -56,7 +55,7 @@ class LoginApiHelper {
56
55
  // Extract the authorization code from the location header
57
56
  return new URLSearchParams(locationHeader.split('?')[1]).get('code');
58
57
  }
59
- async getRefreshToken(cookie, codeVerifier, authorizationCode) {
58
+ async getCookiesWithAccessTokenAndRefreshToken(cookie, codeVerifier, authorizationCode) {
60
59
  const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {
61
60
  headers: {
62
61
  'Content-Type': 'application/x-www-form-urlencoded',
@@ -73,9 +72,9 @@ class LoginApiHelper {
73
72
  ignoreHTTPSErrors: true
74
73
  });
75
74
  if (response.status() !== 200) {
76
- console.error('Failed to retrieve refresh token');
75
+ console.error('Failed to retrieve cookie');
77
76
  }
78
- return await response.json();
77
+ return response.headers()['set-cookie'];
79
78
  }
80
79
  async getAccessToken(cookie, refreshToken) {
81
80
  const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {
@@ -1 +1 @@
1
- {"version":3,"file":"LoginApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/LoginApiHelper.ts"],"names":[],"mappings":";;;AAEA,mCAAkC;AAElC,MAAa,cAAc;IACzB,GAAG,CAAa;IAChB,IAAI,CAAO;IAEX,YAAY,GAAe,EAAE,IAAU;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,SAAiB,EAAE,QAAgB;QACpD,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,mCAAmC;QACjE,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,mCAAmC;QACtE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACzD,MAAM,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AAC,OAAO,GAAG,yBAAyB;gBAC1D,IAAI,EAAE,iBAAiB;gBACvB,aAAa,EAAE,YAAY;aAC5B;YACD,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACnD;QACD,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAc,EAAE,YAAoB;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,uDAAuD,EAAE;YACxH,OAAO,EAAE;gBACP,cAAc,EAAE,mCAAmC;gBACnD,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO;aACzB;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,eAAe;gBAC3B,SAAS,EAAE,qBAAqB;gBAChC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,yBAAyB;gBAC1D,aAAa,EAAE,YAAY;aAC5B;YACD,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE;YAC7B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;SACjC;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;SAC/B;QACD,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACF;AA5GD,wCA4GC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\nimport {Page} from \"@playwright/test\";\nimport {createHash} from \"crypto\";\n\nexport class LoginApiHelper {\n api: ApiHelpers;\n page: Page;\n\n constructor(api: ApiHelpers, page: Page) {\n this.api = api;\n this.page = page;\n }\n\n public async login(userEmail: string, password: string) {\n const codeVerifier = \"12345\"; // A static state value for testing\n const stateValue = 'myStateValue'; // A static state value for testing\n const cookie = await this.getCookie(userEmail, password);\n const codeChallenge = await this.createCodeChallenge(codeVerifier);\n const authorizationCode = await this.getAuthorizationCode(codeChallenge, cookie, stateValue);\n const refreshToken = await this.getRefreshToken(cookie, codeVerifier, authorizationCode);\n const accessToken = await this.getAccessToken(cookie, refreshToken.refresh_token);\n return {cookie, accessToken, refreshToken};\n }\n\n async getCookie(userEmail: string, password: string) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/login', {\n headers: {\n 'Content-Type': 'application/json',\n Referer: this.api.baseUrl,\n Origin: this.api.baseUrl,\n },\n data: {\n username: userEmail,\n password: password\n },\n ignoreHTTPSErrors: true\n });\n\n // Ensure the cookie is properly captured\n return response.headers()['set-cookie'];\n }\n\n async createCodeChallenge(codeVerifier: string) {\n return createHash('sha256').update(codeVerifier, 'utf8').digest('base64').replace(/=/g, '').trim();\n }\n\n async getAuthorizationCode(codeChallenge: string, cookie: string, stateValue: string) {\n const authorizationUrl = `${this.api.baseUrl}/umbraco/management/api/v1/security/back-office/authorize?client_id=umbraco-back-office&response_type=code&redirect_uri=${encodeURIComponent(this.api.baseUrl + '/umbraco/oauth_complete')}&code_challenge_method=S256&code_challenge=${codeChallenge}&state=${stateValue}&scope=offline_access&prompt=consent&access_type=offline`;\n const response = await this.page.request.get(authorizationUrl, {\n headers: {\n Cookie: cookie,\n Referer: this.api.baseUrl,\n },\n ignoreHTTPSErrors: true,\n maxRedirects: 0\n });\n\n // Parse the authorization code from the redirect URL\n const locationHeader = response.headers()['location'];\n if (!locationHeader) {\n throw new Error('Authorization redirect location not found');\n }\n // Extract the authorization code from the location header\n return new URLSearchParams(locationHeader.split('?')[1]).get('code');\n }\n\n async getRefreshToken(cookie: string, codeVerifier: string, authorizationCode) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.api.baseUrl\n },\n form: {\n grant_type: 'authorization_code',\n client_id: 'umbraco-back-office',\n redirect_uri: this.api.baseUrl + '/umbraco/oauth_complete',\n code: authorizationCode,\n code_verifier: codeVerifier\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() !== 200) {\n console.error('Failed to retrieve refresh token');\n }\n return await response.json();\n }\n\n async getAccessToken(cookie: string, refreshToken: string) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.api.baseUrl\n },\n form: {\n grant_type: 'refresh_token',\n client_id: 'umbraco-back-office',\n redirect_uri: this.api.baseUrl + '/umbraco/oauth_complete',\n refresh_token: refreshToken,\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() === 200) {\n console.log('Login successful');\n } else {\n console.error('Login failed');\n }\n return await response.json();\n }\n}\n"]}
1
+ {"version":3,"file":"LoginApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/LoginApiHelper.ts"],"names":[],"mappings":";;;AAEA,mCAAkC;AAElC,MAAa,cAAc;IACzB,GAAG,CAAa;IAChB,IAAI,CAAO;IAEX,YAAY,GAAe,EAAE,IAAU;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,SAAiB,EAAE,QAAgB;QACpD,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,mCAAmC;QACjE,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,mCAAmC;QACtE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACzD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,mBAAmB,C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AQ,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC5C;QACD,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAc,EAAE,YAAoB;QACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,uDAAuD,EAAE;YACxH,OAAO,EAAE;gBACP,cAAc,EAAE,mCAAmC;gBACnD,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO;aACzB;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE,eAAe;gBAC3B,SAAS,EAAE,qBAAqB;gBAChC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,yBAAyB;gBAC1D,aAAa,EAAE,YAAY;aAC5B;YACD,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,EAAE;YAC7B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;SACjC;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;SAC/B;QACD,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACF;AA3GD,wCA2GC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\nimport {Page} from \"@playwright/test\";\nimport {createHash} from \"crypto\";\n\nexport class LoginApiHelper {\n api: ApiHelpers;\n page: Page;\n\n constructor(api: ApiHelpers, page: Page) {\n this.api = api;\n this.page = page;\n }\n\n public async login(userEmail: string, password: string) {\n const codeVerifier = \"12345\"; // A static state value for testing\n const stateValue = 'myStateValue'; // A static state value for testing\n const cookie = await this.getCookie(userEmail, password);\n const codeChallenge = await this.createCodeChallenge(codeVerifier);\n const authorizationCode = await this.getAuthorizationCode(codeChallenge, cookie, stateValue);\n const setCookies = await this.getCookiesWithAccessTokenAndRefreshToken(cookie, codeVerifier, authorizationCode);\n return {cookie, setCookies};\n }\n\n async getCookie(userEmail: string, password: string) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/login', {\n headers: {\n 'Content-Type': 'application/json',\n Referer: this.api.baseUrl,\n Origin: this.api.baseUrl,\n },\n data: {\n username: userEmail,\n password: password\n },\n ignoreHTTPSErrors: true\n });\n\n // Ensure the cookie is properly captured\n return response.headers()['set-cookie'];\n }\n\n async createCodeChallenge(codeVerifier: string) {\n return createHash('sha256').update(codeVerifier, 'utf8').digest('base64').replace(/=/g, '').trim();\n }\n\n async getAuthorizationCode(codeChallenge: string, cookie: string, stateValue: string) {\n const authorizationUrl = `${this.api.baseUrl}/umbraco/management/api/v1/security/back-office/authorize?client_id=umbraco-back-office&response_type=code&redirect_uri=${encodeURIComponent(this.api.baseUrl + '/umbraco/oauth_complete')}&code_challenge_method=S256&code_challenge=${codeChallenge}&state=${stateValue}&scope=offline_access&prompt=consent&access_type=offline`;\n const response = await this.page.request.get(authorizationUrl, {\n headers: {\n Cookie: cookie,\n Referer: this.api.baseUrl,\n },\n ignoreHTTPSErrors: true,\n maxRedirects: 0\n });\n\n // Parse the authorization code from the redirect URL\n const locationHeader = response.headers()['location'];\n if (!locationHeader) {\n throw new Error('Authorization redirect location not found');\n }\n // Extract the authorization code from the location header\n return new URLSearchParams(locationHeader.split('?')[1]).get('code');\n }\n\n async getCookiesWithAccessTokenAndRefreshToken(cookie: string, codeVerifier: string, authorizationCode) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.api.baseUrl\n },\n form: {\n grant_type: 'authorization_code',\n client_id: 'umbraco-back-office',\n redirect_uri: this.api.baseUrl + '/umbraco/oauth_complete',\n code: authorizationCode,\n code_verifier: codeVerifier\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() !== 200) {\n console.error('Failed to retrieve cookie');\n }\n return response.headers()['set-cookie'];\n }\n\n async getAccessToken(cookie: string, refreshToken: string) {\n const response = await this.page.request.post(this.api.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: cookie,\n Origin: this.api.baseUrl\n },\n form: {\n grant_type: 'refresh_token',\n client_id: 'umbraco-back-office',\n redirect_uri: this.api.baseUrl + '/umbraco/oauth_complete',\n refresh_token: refreshToken,\n },\n ignoreHTTPSErrors: true\n });\n\n if (response.status() === 200) {\n console.log('Login successful');\n } else {\n console.error('Login failed');\n }\n return await response.json();\n }\n}\n"]}
@@ -151,6 +151,8 @@ export declare class UiBaseLocators {
151
151
  readonly openedModal: Locator;
152
152
  readonly uiLoader: Locator;
153
153
  readonly createDocumentBlueprintModal: Locator;
154
+ readonly entityItem: Locator;
155
+ readonly sectionLinks: Locator;
154
156
  constructor(page: Page);
155
157
  clickActionsMenuForNameInSectionSidebar(name: string): Promise<void>;
156
158
  clickActionsMenuForName(name: string): Promise<void>;
@@ -352,6 +354,7 @@ export declare class UiBaseLocators {
352
354
  isMediaCardItemWithNameVisible(itemName: string, isVisible?: boolean): Promise<void>;
353
355
  clickWorkspaceActionMenuButton(): Promise<void>;
354
356
  clickLockActionMenuOption(): Promise<void>;
357
+ isDashboardTabWithNameVisible(name: string, isVisible?: boolean): Promise<void>;
355
358
  enterMonacoEditorValue(value: string): Promise<void>;
356
359
  waitUntilUiLoaderIsNoLongerVisible(): Promise<void>;
357
360
  isWorkspaceViewTabWithAliasVisible(alias: string, isVisible?: boolean): Promise<void>;
@@ -155,6 +155,8 @@ class UiBaseLocators {
155
155
  openedModal;
156
156
  uiLoader;
157
157
  createDocumentBlueprintModal;
158
+ entityItem;
159
+ sectionLinks;
158
160
  constructor(page) {
159
161
  this.page = page;
160
162
  this.saveBtn = page.getByLabel('Save', { exact: true });
@@ -302,6 +304,7 @@ class UiBaseLocators {
302
304
  this.successStateIcon = this.successState.locator('#state');
303
305
  this.workspaceAction = page.locator('umb-workspace-action');
304
306
  this.caretBtn = page.locator('#caret-button');
307
+ this.sectionLinks = page.getByTestId('section-links');
305
308
  // Entity Action
306
309
  this.entityAction = page.locator('umb-entity-action-list umb-entity-action');
307
310
  this.openEntityAction = page.locator('#action-modal[open]').locator(this.entityAction);
@@ -317,6 +320,8 @@ class UiBaseLocators {
317
320
  }
318
321
  async clickActionsMenuForName(name) {
319
322
  await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"]').locator('#menu-item').first()).toBeVisible();
323
+ // We need to wait for the load to be finished, otherwise we would run into flaky tests
324
+ await this.page.waitForTimeout(2000);
320
325
  await this.page.locator('uui-menu-item[label="' + name + '"]').locator('#menu-item').first().hover({ force: true });
321
326
  await this.page.locator('uui-menu-item[label="' + name + '"] #action-modal').first().click({ force: true });
322
327
  }
@@ -591,10 +596,17 @@ class UiBaseLocators {
591
596
  async goToSection(sectionName, checkSections = true) {
592
597
  if (checkSections) {
593
598
  for (let section in ConstantHelper_1.ConstantHelper.sections) {
594
- await (0, test_1.expect)(this.backOfficeHeader.getByRole('tab', { name: ConstantHelper_1.ConstantHelper.sections[section] })).toBeVisible({ timeout: 30000 });
599
+ await (0, test_1.expect)(this.sectionLinks.getByRole('tab', { name: ConstantHelper_1.ConstantHelper.sections[section] })).toBeVisible({ timeout: 30000 });
595
600
  }
596
601
  }
597
- await this.backOfficeHeader.getByRole('tab', { name: sectionName }).click();
602
+ // We need to check if we are on the section tab already, if we are, then we need to reload the page instead of clicking again
603
+ const alreadySelected = await this.sectionLinks.locator('[active]').getByText(sectionName).isVisible();
604
+ if (alreadySelected) {
605
+ await this.page.reload();
606
+ }
607
+ else {
608
+ await this.backOfficeHeader.getByRole('tab', { name: sectionName }).click();
609
+ }
598
610
  }
599
611
  async goToSettingsTreeItem(settingsTreeItemName) {
600
612
  await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
@@ -1212,6 +1224,9 @@ class UiBaseLocators {
1212
1224
  async clickLockActionMenuOption() {
1213
1225
  await this.clickEntityActionWithName('Lock');
1214
1226
  }
1227
+ async isDashboardTabWithNameVisible(name, isVisible = true) {
1228
+ await (0, test_1.expect)(this.page.locator('uui-tab[label="' + name + '"]')).toBeVisible({ visible: isVisible });
1229
+ }
1215
1230
  async enterMonacoEditorValue(value) {
1216
1231
  await (0, test_1.expect)(this.monacoEditor).toBeVisible();
1217
1232
  await this.monacoEditor.click();