@umbraco/playwright-testhelpers 2.0.0-beta.82 → 2.0.0-beta.84
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.
- package/dist/lib/helpers/ApiHelpers.d.ts +3 -0
- package/dist/lib/helpers/ApiHelpers.js +54 -13
- package/dist/lib/helpers/ApiHelpers.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +34 -0
- package/dist/lib/helpers/ContentUiHelper.js +100 -1
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeApiHelper.d.ts +2 -0
- package/dist/lib/helpers/DataTypeApiHelper.js +66 -0
- package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentApiHelper.d.ts +1 -0
- package/dist/lib/helpers/DocumentApiHelper.js +5 -0
- package/dist/lib/helpers/DocumentApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +5 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js +81 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/LoginApiHelper.d.ts +3 -2
- package/dist/lib/helpers/LoginApiHelper.js +26 -3
- package/dist/lib/helpers/LoginApiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaUiHelper.d.ts +0 -8
- package/dist/lib/helpers/MediaUiHelper.js +0 -38
- package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +10 -0
- package/dist/lib/helpers/UiBaseLocators.js +41 -0
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -86,6 +86,9 @@ export declare class ApiHelpers {
|
|
|
86
86
|
private currentDateToEpoch;
|
|
87
87
|
private dateToEpoch;
|
|
88
88
|
refreshAccessToken(): Promise<void>;
|
|
89
|
+
readFileContent(filePath: any): Promise<any>;
|
|
90
|
+
readLocalBearerToken(): Promise<string>;
|
|
91
|
+
readLocalCookie(): Promise<string>;
|
|
89
92
|
private updateLocalStorage;
|
|
90
93
|
private updateCookie;
|
|
91
94
|
}
|
|
@@ -117,8 +117,8 @@ class ApiHelpers {
|
|
|
117
117
|
}
|
|
118
118
|
async getHeaders() {
|
|
119
119
|
return {
|
|
120
|
-
'Authorization': await this.
|
|
121
|
-
'Cookie': await this.
|
|
120
|
+
'Authorization': await this.readLocalBearerToken(),
|
|
121
|
+
'Cookie': await this.readLocalCookie(),
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
async get(url, params) {
|
|
@@ -196,7 +196,7 @@ class ApiHelpers {
|
|
|
196
196
|
const globalTestTimeout = 45;
|
|
197
197
|
// We want to have the date minus the globalTimeout, the reason for this is that while a test is running, the token could expire.
|
|
198
198
|
// 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
|
|
199
|
-
const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout
|
|
199
|
+
const tokenRefreshTime = tokenTimeIssued + tokenExpireTime - (globalTestTimeout);
|
|
200
200
|
// We need the currentTimeInEpoch so we can check if the tokenRefreshTime is close to expiring.
|
|
201
201
|
const currentTimeInEpoch = await this.currentDateToEpoch();
|
|
202
202
|
if (tokenRefreshTime <= currentTimeInEpoch) {
|
|
@@ -215,27 +215,68 @@ class ApiHelpers {
|
|
|
215
215
|
return Number(millisecondsToSeconds.toString().split('.')[0]);
|
|
216
216
|
}
|
|
217
217
|
async refreshAccessToken() {
|
|
218
|
-
const response = await this.page.
|
|
218
|
+
const response = await this.page.request.post(this.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {
|
|
219
219
|
headers: {
|
|
220
220
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
221
|
-
Cookie: await this.
|
|
221
|
+
Cookie: await this.readLocalCookie(),
|
|
222
|
+
Origin: this.baseUrl
|
|
222
223
|
},
|
|
223
224
|
form: {
|
|
224
225
|
grant_type: 'refresh_token',
|
|
225
226
|
client_id: 'umbraco-back-office',
|
|
226
|
-
redirect_uri:
|
|
227
|
+
redirect_uri: this.baseUrl + '/umbraco/oauth_complete',
|
|
227
228
|
refresh_token: await this.getRefreshToken()
|
|
228
|
-
}
|
|
229
|
+
},
|
|
230
|
+
ignoreHTTPSErrors: true
|
|
229
231
|
});
|
|
230
232
|
if (response.status() === 200) {
|
|
231
233
|
const jsonStorageValue = await response.json();
|
|
232
234
|
return this.updateLocalStorage(jsonStorageValue);
|
|
233
235
|
}
|
|
234
236
|
console.log('Error refreshing access token.');
|
|
235
|
-
console.log('Attempting login...');
|
|
236
237
|
const storageStateValues = await this.login.login();
|
|
237
238
|
await this.updateCookie(storageStateValues.cookie);
|
|
238
|
-
await this.updateLocalStorage(storageStateValues.
|
|
239
|
+
await this.updateLocalStorage(storageStateValues.accessToken);
|
|
240
|
+
}
|
|
241
|
+
async readFileContent(filePath) {
|
|
242
|
+
try {
|
|
243
|
+
const jsonString = fs.readFileSync(filePath, 'utf-8');
|
|
244
|
+
return JSON.parse(jsonString);
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
console.log('Error reading file:', error);
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async readLocalBearerToken() {
|
|
252
|
+
const filePath = process.env.STORAGE_STAGE_PATH;
|
|
253
|
+
if (!filePath) {
|
|
254
|
+
return await this.getBearerToken();
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
258
|
+
const localStorageItem = data.origins[0]?.localStorage?.find(item => item.name === 'umb:userAuthTokenResponse');
|
|
259
|
+
const parsedValue = JSON.parse(localStorageItem.value);
|
|
260
|
+
return `Bearer ${parsedValue.access_token}`;
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
// If the file is not found, return the current access token from the page context
|
|
264
|
+
return await this.getBearerToken();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async readLocalCookie() {
|
|
268
|
+
const filePath = process.env.STORAGE_STAGE_PATH;
|
|
269
|
+
if (!filePath) {
|
|
270
|
+
return await this.getCookie();
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
const data = await JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
274
|
+
return data.cookies.map(cookie => `${cookie.name}=${cookie.value}`).join('; ') + ';';
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
// If the file is not found, return the current cookie from the page context
|
|
278
|
+
return await this.getCookie();
|
|
279
|
+
}
|
|
239
280
|
}
|
|
240
281
|
async updateLocalStorage(localStorageValue) {
|
|
241
282
|
const currentStorageState = await this.page.context().storageState();
|
|
@@ -244,13 +285,14 @@ class ApiHelpers {
|
|
|
244
285
|
currentLocalStorageValue.access_token = localStorageValue.access_token;
|
|
245
286
|
currentLocalStorageValue.refresh_token = localStorageValue.refresh_token;
|
|
246
287
|
currentLocalStorageValue.issued_at = newIssuedTime;
|
|
288
|
+
currentLocalStorageValue.scope = localStorageValue.scope;
|
|
289
|
+
currentLocalStorageValue.token_type = localStorageValue.token_type;
|
|
247
290
|
currentLocalStorageValue.expires_in = localStorageValue.expires_in.toString();
|
|
248
291
|
const filePath = process.env.STORAGE_STAGE_PATH;
|
|
249
292
|
// Updates the user.json file in our CMS project
|
|
250
293
|
if (filePath) {
|
|
251
|
-
const jsonString = fs.readFileSync(filePath, 'utf-8');
|
|
252
294
|
try {
|
|
253
|
-
const data =
|
|
295
|
+
const data = await this.readFileContent(filePath);
|
|
254
296
|
const localStorage = data.origins[0].localStorage[0];
|
|
255
297
|
if (localStorage.name === 'umb:userAuthTokenResponse') {
|
|
256
298
|
localStorage.value = JSON.stringify(currentLocalStorageValue);
|
|
@@ -285,8 +327,7 @@ class ApiHelpers {
|
|
|
285
327
|
const filePath = process.env.STORAGE_STAGE_PATH;
|
|
286
328
|
if (filePath) {
|
|
287
329
|
try {
|
|
288
|
-
const
|
|
289
|
-
const data = JSON.parse(jsonString);
|
|
330
|
+
const data = await this.readFileContent(filePath);
|
|
290
331
|
data.cookies[0] = currentCookie;
|
|
291
332
|
const updatedJsonString = JSON.stringify(data, null, 2);
|
|
292
333
|
fs.writeFileSync(filePath, updatedJsonString, 'utf-8');
|
|
@@ -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;AAEhD,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;IAC5B,UAAU,CAAsB;IAChC,YAAY,CAAwB;IACpC,SAAS,CAAqB;IAC9B,QAAQ,CAAoB;IAC5B,QAAQ,CAAoB;IAC5B,IAAI,CAAgB;IACpB,aAAa,CAAyB;IACtC,YAAY,CAAwB;IACpC,QAAQ,CAAoB;IAC5B,OAAO,CAAmB;IAC1B,MAAM,CAAkB;IACx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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\";\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\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 }\n\n async getBearerToken() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return 'Bearer ' + someObject.access_token;\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.getBearerToken(),\n 'Cookie': await this.getCookie(),\n }\n }\n\n async get(url: string, params?: { [key: string]: string | number | boolean; }) {\n const options = {\n headers: await this.getHeaders(),\n params: params,\n ignoreHTTPSErrors: true\n }\n return 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 let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return Number(someObject.issued_at);\n }\n\n private async getTokenExpireTime() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return Number(someObject.expires_in);\n }\n\n private async getRefreshToken() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return someObject.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 + 240);\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();\n }\n }\n\n private async currentDateToEpoch() {\n const currentTime = new Date(Date.now());\n return 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() {\n const response = await this.page.context().request.post(umbracoConfig.environment.baseUrl + '/umbraco/management/api/v1/security/back-office/token', {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Cookie: await this.getCookie()\n },\n form:\n {\n grant_type: 'refresh_token',\n client_id: 'umbraco-back-office',\n redirect_uri: umbracoConfig.environment.baseUrl + '/umbraco/oauth_complete',\n refresh_token: await this.getRefreshToken()\n }\n });\n\n if (response.status() === 200) {\n const jsonStorageValue = await response.json();\n return this.updateLocalStorage(jsonStorageValue);\n }\n\n console.log('Error refreshing access token.');\n console.log('Attempting login...');\n const storageStateValues = await this.login.login();\n await this.updateCookie(storageStateValues.cookie);\n await this.updateLocalStorage(storageStateValues.token);\n }\n\n private async updateLocalStorage(localStorageValue) {\n const currentStorageState = await this.page.context().storageState();\n let currentLocalStorageValue = JSON.parse(currentStorageState.origins[0].localStorage[0].value);\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.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 const jsonString = fs.readFileSync(filePath, 'utf-8');\n try {\n const data = JSON.parse(jsonString);\n const localStorage = data.origins[0].localStorage[0];\n if (localStorage.name === 'umb:userAuthTokenResponse') {\n localStorage.value = JSON.stringify(currentLocalStorageValue);\n }\n\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 jsonString = fs.readFileSync(filePath, 'utf-8');\n const data = JSON.parse(jsonString);\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}"]}
|
|
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;AAEhD,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;IAC5B,UAAU,CAAsB;IAChC,YAAY,CAAwB;IACpC,SAAS,CAAqB;IAC9B,QAAQ,CAAoB;IAC5B,QAAQ,CAAoB;IAC5B,IAAI,CAAgB;IACpB,aAAa,CAAyB;IACtC,YAAY,CAAwB;IACpC,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AChC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACxD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;aACxD;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;aAChD;SACF;IACH,CAAC;CACF;AA3UD,gCA2UC","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\";\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\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 }\n\n async getBearerToken() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return 'Bearer ' + someObject.access_token;\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; }) {\n const options = {\n headers: await this.getHeaders(),\n params: params,\n ignoreHTTPSErrors: true\n }\n return 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 let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return Number(someObject.issued_at);\n }\n\n private async getTokenExpireTime() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return Number(someObject.expires_in);\n }\n\n private async getRefreshToken() {\n let someStorage = await this.page.context().storageState();\n let someObject = JSON.parse(someStorage.origins[0].localStorage[0].value);\n return someObject.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();\n }\n }\n\n private async currentDateToEpoch() {\n const currentTime = new Date(Date.now());\n return 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() {\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 this.updateLocalStorage(jsonStorageValue);\n }\n console.log('Error refreshing access token.');\n const storageStateValues = await this.login.login();\n await this.updateCookie(storageStateValues.cookie);\n await this.updateLocalStorage(storageStateValues.accessToken);\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 = data.origins[0]?.localStorage?.find(item => item.name === 'umb:userAuthTokenResponse');\n const parsedValue = 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 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 updateLocalStorage(localStorageValue) {\n const currentStorageState = await this.page.context().storageState();\n let currentLocalStorageValue = JSON.parse(currentStorageState.origins[0].localStorage[0].value);\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 localStorage = data.origins[0].localStorage[0];\n if (localStorage.name === 'umb:userAuthTokenResponse') {\n localStorage.value = JSON.stringify(currentLocalStorageValue);\n }\n\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}"]}
|
|
@@ -55,6 +55,20 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
55
55
|
private readonly markdownTxt;
|
|
56
56
|
private readonly codeEditorTxt;
|
|
57
57
|
private readonly sliderInput;
|
|
58
|
+
private readonly tabItems;
|
|
59
|
+
private readonly documentWorkspace;
|
|
60
|
+
private readonly documentTableColumnNames;
|
|
61
|
+
private readonly searchTxt;
|
|
62
|
+
private readonly enterNameInContainerTxt;
|
|
63
|
+
private readonly listView;
|
|
64
|
+
private readonly nameBtn;
|
|
65
|
+
private readonly listViewTableRow;
|
|
66
|
+
private readonly publishSelectedListItems;
|
|
67
|
+
private readonly unpublishSelectedListItems;
|
|
68
|
+
private readonly duplicateToSelectedListItems;
|
|
69
|
+
private readonly moveToSelectedListItems;
|
|
70
|
+
private readonly trashSelectedListItems;
|
|
71
|
+
private readonly modalContent;
|
|
58
72
|
constructor(page: Page);
|
|
59
73
|
enterContentName(name: string): Promise<void>;
|
|
60
74
|
clickSaveAndPublishButton(): Promise<void>;
|
|
@@ -138,4 +152,24 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
138
152
|
enterCodeEditorValue(value: string): Promise<void>;
|
|
139
153
|
enterMarkdownEditorValue(value: string): Promise<void>;
|
|
140
154
|
changeSliderValue(value: string): Promise<void>;
|
|
155
|
+
isDocumentTypeNameVisible(contentName: string, isVisible?: boolean): Promise<void>;
|
|
156
|
+
doesModalHaveText(text: string): Promise<void>;
|
|
157
|
+
isTabNameVisible(tabName: string): Promise<void>;
|
|
158
|
+
doesDocumentWorkspaceHaveText(text: string): Promise<void>;
|
|
159
|
+
doesDocumentTableColumnNameValuesMatch(expectedValues: string[]): Promise<void>;
|
|
160
|
+
searchByKeywordInCollection(keyword: string): Promise<void>;
|
|
161
|
+
clickCreateContentWithName(name: string): Promise<void>;
|
|
162
|
+
enterNameInContainer(name: string): Promise<void>;
|
|
163
|
+
goToContentInListViewWithName(contentName: string): Promise<void>;
|
|
164
|
+
doesListViewHaveNoItemsInList(): Promise<void>;
|
|
165
|
+
clickNameButtonInListView(): Promise<void>;
|
|
166
|
+
doesFirstItemInListViewHaveName(name: string): Promise<void>;
|
|
167
|
+
doesListViewContainCount(count: number): Promise<void>;
|
|
168
|
+
selectContentWithNameInListView(name: string): Promise<void>;
|
|
169
|
+
clickPublishSelectedListItems(): Promise<void>;
|
|
170
|
+
clickUnpublishSelectedListItems(): Promise<void>;
|
|
171
|
+
clickDuplicateToSelectedListItems(): Promise<void>;
|
|
172
|
+
clickMoveToSelectedListItems(): Promise<void>;
|
|
173
|
+
clickTrashSelectedListItems(): Promise<void>;
|
|
174
|
+
selectDocumentWithNameAtRoot(name: string): Promise<void>;
|
|
141
175
|
}
|
|
@@ -58,6 +58,20 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
58
58
|
markdownTxt;
|
|
59
59
|
codeEditorTxt;
|
|
60
60
|
sliderInput;
|
|
61
|
+
tabItems;
|
|
62
|
+
documentWorkspace;
|
|
63
|
+
documentTableColumnNames;
|
|
64
|
+
searchTxt;
|
|
65
|
+
enterNameInContainerTxt;
|
|
66
|
+
listView;
|
|
67
|
+
nameBtn;
|
|
68
|
+
listViewTableRow;
|
|
69
|
+
publishSelectedListItems;
|
|
70
|
+
unpublishSelectedListItems;
|
|
71
|
+
duplicateToSelectedListItems;
|
|
72
|
+
moveToSelectedListItems;
|
|
73
|
+
trashSelectedListItems;
|
|
74
|
+
modalContent;
|
|
61
75
|
constructor(page) {
|
|
62
76
|
super(page);
|
|
63
77
|
this.contentNameTxt = page.locator('#name-input input');
|
|
@@ -96,6 +110,10 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
96
110
|
this.markdownTxt = page.locator('umb-input-markdown textarea');
|
|
97
111
|
this.codeEditorTxt = page.locator('umb-code-editor textarea');
|
|
98
112
|
this.sliderInput = page.locator('umb-property-editor-ui-slider #input');
|
|
113
|
+
this.tabItems = page.locator('uui-tab');
|
|
114
|
+
this.documentWorkspace = page.locator('umb-document-workspace-editor');
|
|
115
|
+
this.documentTableColumnNames = page.locator('umb-document-table-column-name');
|
|
116
|
+
this.searchTxt = this.documentWorkspace.locator('#input-search input');
|
|
99
117
|
// Info tab
|
|
100
118
|
this.infoTab = page.getByRole('tab', { name: 'Info' });
|
|
101
119
|
this.linkContent = page.locator('.link-content');
|
|
@@ -106,7 +124,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
106
124
|
this.editDocumentTypeBtn = this.generalItem.filter({ hasText: 'Document Type' }).locator('#button');
|
|
107
125
|
this.addTemplateBtn = this.generalItem.filter({ hasText: 'Template' }).locator('#button');
|
|
108
126
|
this.id = this.generalItem.filter({ hasText: 'Id' }).locator('span');
|
|
109
|
-
//
|
|
127
|
+
// Culture and Hostname
|
|
110
128
|
this.cultureAndHostnamesBtn = page.getByLabel('Culture and Hostnames');
|
|
111
129
|
this.cultureLanguageDropdownBox = page.locator('[headline="Culture"]').getByLabel('combobox-input');
|
|
112
130
|
this.addNewDomainBtn = page.getByLabel('Add new domain');
|
|
@@ -116,6 +134,17 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
116
134
|
this.domainComboBox = page.locator('#domains uui-combobox');
|
|
117
135
|
this.saveModalBtn = this.sidebarModal.getByLabel('Save', { exact: true });
|
|
118
136
|
this.resetFocalPointBtn = this.page.getByLabel('Reset focal point');
|
|
137
|
+
// List View
|
|
138
|
+
this.enterNameInContainerTxt = page.locator('#container').getByLabel('Enter a name...');
|
|
139
|
+
this.listView = page.locator('umb-document-table-collection-view');
|
|
140
|
+
this.nameBtn = page.getByRole('button', { name: 'Name' });
|
|
141
|
+
this.listViewTableRow = this.listView.locator('uui-table-row');
|
|
142
|
+
this.publishSelectedListItems = page.getByRole('button', { name: 'Publish', exact: true });
|
|
143
|
+
this.unpublishSelectedListItems = page.getByRole('button', { name: 'Unpublish', exact: true });
|
|
144
|
+
this.duplicateToSelectedListItems = page.getByRole('button', { name: 'Duplicate to', exact: true });
|
|
145
|
+
this.moveToSelectedListItems = page.getByRole('button', { name: 'Move to', exact: true });
|
|
146
|
+
this.trashSelectedListItems = page.getByRole('button', { name: 'Trash', exact: true });
|
|
147
|
+
this.modalContent = page.locator('umb-tree-picker-modal');
|
|
119
148
|
}
|
|
120
149
|
async enterContentName(name) {
|
|
121
150
|
await (0, test_1.expect)(this.contentNameTxt).toBeVisible();
|
|
@@ -426,6 +455,76 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
426
455
|
async changeSliderValue(value) {
|
|
427
456
|
await this.sliderInput.fill(value);
|
|
428
457
|
}
|
|
458
|
+
async isDocumentTypeNameVisible(contentName, isVisible = true) {
|
|
459
|
+
return (0, test_1.expect)(this.sidebarModal.getByText(contentName)).toBeVisible({ visible: isVisible });
|
|
460
|
+
}
|
|
461
|
+
async doesModalHaveText(text) {
|
|
462
|
+
return (0, test_1.expect)(this.sidebarModal).toContainText(text);
|
|
463
|
+
}
|
|
464
|
+
// Collection tab
|
|
465
|
+
async isTabNameVisible(tabName) {
|
|
466
|
+
return (0, test_1.expect)(this.tabItems.filter({ hasText: tabName })).toBeVisible();
|
|
467
|
+
}
|
|
468
|
+
async doesDocumentWorkspaceHaveText(text) {
|
|
469
|
+
return (0, test_1.expect)(this.documentWorkspace).toContainText(text);
|
|
470
|
+
}
|
|
471
|
+
async doesDocumentTableColumnNameValuesMatch(expectedValues) {
|
|
472
|
+
return expectedValues.forEach((text, index) => {
|
|
473
|
+
(0, test_1.expect)(this.documentTableColumnNames.nth(index)).toHaveText(text);
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
async searchByKeywordInCollection(keyword) {
|
|
477
|
+
await this.searchTxt.clear();
|
|
478
|
+
await this.searchTxt.fill(keyword);
|
|
479
|
+
await this.searchTxt.press('Enter');
|
|
480
|
+
await this.page.waitForTimeout(500);
|
|
481
|
+
}
|
|
482
|
+
// List View
|
|
483
|
+
async clickCreateContentWithName(name) {
|
|
484
|
+
await (0, test_1.expect)(this.page.getByLabel('Create ' + name)).toBeVisible();
|
|
485
|
+
await this.page.getByLabel('Create ' + name).click();
|
|
486
|
+
}
|
|
487
|
+
async enterNameInContainer(name) {
|
|
488
|
+
await this.enterNameInContainerTxt.fill(name);
|
|
489
|
+
}
|
|
490
|
+
async goToContentInListViewWithName(contentName) {
|
|
491
|
+
await this.listView.getByLabel(contentName).click();
|
|
492
|
+
}
|
|
493
|
+
async doesListViewHaveNoItemsInList() {
|
|
494
|
+
await (0, test_1.expect)(this.listView.filter({ hasText: 'There are no items to show in the list.' })).toBeVisible();
|
|
495
|
+
}
|
|
496
|
+
async clickNameButtonInListView() {
|
|
497
|
+
await this.nameBtn.click();
|
|
498
|
+
}
|
|
499
|
+
async doesFirstItemInListViewHaveName(name) {
|
|
500
|
+
await (0, test_1.expect)(this.listViewTableRow.first()).toContainText(name);
|
|
501
|
+
}
|
|
502
|
+
async doesListViewContainCount(count) {
|
|
503
|
+
await (0, test_1.expect)(this.listViewTableRow).toHaveCount(count);
|
|
504
|
+
}
|
|
505
|
+
async selectContentWithNameInListView(name) {
|
|
506
|
+
await this.listViewTableRow.filter({ hasText: name }).click();
|
|
507
|
+
}
|
|
508
|
+
async clickPublishSelectedListItems() {
|
|
509
|
+
await this.publishSelectedListItems.click();
|
|
510
|
+
}
|
|
511
|
+
async clickUnpublishSelectedListItems() {
|
|
512
|
+
await this.unpublishSelectedListItems.click();
|
|
513
|
+
}
|
|
514
|
+
async clickDuplicateToSelectedListItems() {
|
|
515
|
+
await this.duplicateToSelectedListItems.click({ force: true });
|
|
516
|
+
}
|
|
517
|
+
async clickMoveToSelectedListItems() {
|
|
518
|
+
await this.moveToSelectedListItems.click({ force: true });
|
|
519
|
+
}
|
|
520
|
+
async clickTrashSelectedListItems() {
|
|
521
|
+
await this.trashSelectedListItems.click();
|
|
522
|
+
}
|
|
523
|
+
async selectDocumentWithNameAtRoot(name) {
|
|
524
|
+
await this.clickCaretButtonForName('Content');
|
|
525
|
+
await this.modalContent.getByLabel(name).click({ force: true });
|
|
526
|
+
await this.clickChooseButton();
|
|
527
|
+
}
|
|
429
528
|
}
|
|
430
529
|
exports.ContentUiHelper = ContentUiHelper;
|
|
431
530
|
//# sourceMappingURL=ContentUiHelper.js.map
|