@umbraco/playwright-testhelpers 2.0.0-beta.58 → 2.0.0-beta.59
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 +2 -0
- package/dist/lib/helpers/ApiHelpers.js +3 -0
- package/dist/lib/helpers/ApiHelpers.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +2 -0
- package/dist/lib/helpers/ContentUiHelper.js +5 -0
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentBlueprintApiHelper.d.ts +18 -0
- package/dist/lib/helpers/DocumentBlueprintApiHelper.js +126 -0
- package/dist/lib/helpers/DocumentBlueprintApiHelper.js.map +1 -0
- package/dist/lib/helpers/DocumentBlueprintUiHelper.d.ts +18 -0
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js +54 -0
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -0
- package/dist/lib/helpers/PartialViewUiHelper.d.ts +1 -1
- package/dist/lib/helpers/PartialViewUiHelper.js +4 -2
- package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
- package/dist/lib/helpers/ScriptUiHelper.d.ts +1 -1
- package/dist/lib/helpers/ScriptUiHelper.js +4 -2
- package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.d.ts +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js +4 -2
- package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateUiHelper.d.ts +1 -1
- package/dist/lib/helpers/TemplateUiHelper.js +4 -2
- package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.js +1 -1
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UiHelpers.d.ts +2 -0
- package/dist/lib/helpers/UiHelpers.js +3 -0
- package/dist/lib/helpers/UiHelpers.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ import { RedirectManagementApiHelper } from './RedirectManagementApiHelper';
|
|
|
28
28
|
import { MemberGroupApiHelper } from './MemberGroupApiHelper';
|
|
29
29
|
import { MemberApiHelper } from './MemberApiHelper';
|
|
30
30
|
import { MemberTypeApiHelper } from "./MemberTypeApiHelper";
|
|
31
|
+
import { DocumentBlueprintApiHelper } from "./DocumentBlueprintApiHelper";
|
|
31
32
|
export declare class ApiHelpers {
|
|
32
33
|
baseUrl: string;
|
|
33
34
|
page: Page;
|
|
@@ -60,6 +61,7 @@ export declare class ApiHelpers {
|
|
|
60
61
|
memberGroup: MemberGroupApiHelper;
|
|
61
62
|
member: MemberApiHelper;
|
|
62
63
|
memberType: MemberTypeApiHelper;
|
|
64
|
+
documentBlueprint: DocumentBlueprintApiHelper;
|
|
63
65
|
constructor(page: Page);
|
|
64
66
|
getBearerToken(): Promise<string>;
|
|
65
67
|
getCookie(): Promise<string>;
|
|
@@ -32,6 +32,7 @@ const RedirectManagementApiHelper_1 = require("./RedirectManagementApiHelper");
|
|
|
32
32
|
const MemberGroupApiHelper_1 = require("./MemberGroupApiHelper");
|
|
33
33
|
const MemberApiHelper_1 = require("./MemberApiHelper");
|
|
34
34
|
const MemberTypeApiHelper_1 = require("./MemberTypeApiHelper");
|
|
35
|
+
const DocumentBlueprintApiHelper_1 = require("./DocumentBlueprintApiHelper");
|
|
35
36
|
class ApiHelpers {
|
|
36
37
|
baseUrl = umbraco_config_1.umbracoConfig.environment.baseUrl;
|
|
37
38
|
page;
|
|
@@ -64,6 +65,7 @@ class ApiHelpers {
|
|
|
64
65
|
memberGroup;
|
|
65
66
|
member;
|
|
66
67
|
memberType;
|
|
68
|
+
documentBlueprint;
|
|
67
69
|
constructor(page) {
|
|
68
70
|
this.page = page;
|
|
69
71
|
this.alias = new AliasHelper_1.AliasHelper();
|
|
@@ -95,6 +97,7 @@ class ApiHelpers {
|
|
|
95
97
|
this.memberGroup = new MemberGroupApiHelper_1.MemberGroupApiHelper(this);
|
|
96
98
|
this.member = new MemberApiHelper_1.MemberApiHelper(this);
|
|
97
99
|
this.memberType = new MemberTypeApiHelper_1.MemberTypeApiHelper(this);
|
|
100
|
+
this.documentBlueprint = new DocumentBlueprintApiHelper_1.DocumentBlueprintApiHelper(this);
|
|
98
101
|
}
|
|
99
102
|
async getBearerToken() {
|
|
100
103
|
let someStorage = await this.page.context().storageState();
|
|
@@ -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;AAE1D,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,C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,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACrD,IAAI,YAAY,CAAC,IAAI,KAAK,2BAA2B,EAAE;oBACrD,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;iBAC/D;gBAED,qCAAqC;gBACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAExD,8CAA8C;gBAC9C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;gBAEvD,qDAAqD;aACtD;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;aACtD;SACF;IACH,CAAC;CAGF;AAhQD,gCAgQC","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\";\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\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);\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 }\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 = 40;\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 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.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',\n refresh_token: await this.getRefreshToken()\n }\n });\n\n // TODO: If response code is not correct we should throw an error\n\n const newIssuedTime = await this.currentDateToEpoch();\n const jsonStorageValue = await response.json();\n // We need to define a new issued_at time.\n jsonStorageValue.issued_at = newIssuedTime;\n\n if (response.status() === 200) {\n return this.updateLocalStorage(jsonStorageValue);\n }\n console.log('Error refreshing access 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\n currentLocalStorageValue.access_token = localStorageValue.access_token;\n currentLocalStorageValue.refresh_token = localStorageValue.refresh_token;\n currentLocalStorageValue.issued_at = localStorageValue.issued_at;\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\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\n // Writes the updated JSON content to the file\n fs.writeFileSync(filePath, updatedJsonString, 'utf-8');\n\n // console.log('Access token updated successfully.');\n } catch (error) {\n console.error('Error updating access token:', error);\n }\n }\n }\n\n // TODO: Maybe we need to do the same for the cookie? As the cookie expires after some time as well\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;AAExE,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;IACxB,WAAW,CAAuB;IAClC,UAAU,CAAsB;IAChC,SAAS,CAAqB;IAC9B,SAAS,CAAqB;IAC9B,KAAK,CAAiB;IACtB,WAAW,CAAuB;IAClC,aAAa,CAAyB;IACtC,WAAW,CAA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AK,2BAA2B,EAAE;oBACrD,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;iBAC/D;gBAED,qCAAqC;gBACrC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAExD,8CAA8C;gBAC9C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;gBAEvD,qDAAqD;aACtD;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;aACtD;SACF;IACH,CAAC;CAGF;AAlQD,gCAkQC","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\";\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\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);\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 }\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 = 40;\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 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.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',\n refresh_token: await this.getRefreshToken()\n }\n });\n\n // TODO: If response code is not correct we should throw an error\n\n const newIssuedTime = await this.currentDateToEpoch();\n const jsonStorageValue = await response.json();\n // We need to define a new issued_at time.\n jsonStorageValue.issued_at = newIssuedTime;\n\n if (response.status() === 200) {\n return this.updateLocalStorage(jsonStorageValue);\n }\n console.log('Error refreshing access 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\n currentLocalStorageValue.access_token = localStorageValue.access_token;\n currentLocalStorageValue.refresh_token = localStorageValue.refresh_token;\n currentLocalStorageValue.issued_at = localStorageValue.issued_at;\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\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\n // Writes the updated JSON content to the file\n fs.writeFileSync(filePath, updatedJsonString, 'utf-8');\n\n // console.log('Access token updated successfully.');\n } catch (error) {\n console.error('Error updating access token:', error);\n }\n }\n }\n\n // TODO: Maybe we need to do the same for the cookie? As the cookie expires after some time as well\n}"]}
|
|
@@ -35,6 +35,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
35
35
|
private readonly confirmToUnpublishBtn;
|
|
36
36
|
private readonly saveModalBtn;
|
|
37
37
|
private readonly documentTypeNode;
|
|
38
|
+
private readonly createDocumentBlueprintBtn;
|
|
38
39
|
constructor(page: Page);
|
|
39
40
|
enterContentName(name: string): Promise<void>;
|
|
40
41
|
clickSaveAndPublishButton(): Promise<void>;
|
|
@@ -55,6 +56,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
55
56
|
addTags(tagName: string): Promise<void>;
|
|
56
57
|
addContentPicker(contentName: string): Promise<void>;
|
|
57
58
|
clickConfirmToUnpublishButton(): Promise<void>;
|
|
59
|
+
clickCreateDocumentBlueprintButton(): Promise<void>;
|
|
58
60
|
clickInfoTab(): Promise<void>;
|
|
59
61
|
doesLinkHaveText(text: string): Promise<void>;
|
|
60
62
|
doesHistoryHaveText(text: string): Promise<void>;
|
|
@@ -38,6 +38,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
38
38
|
confirmToUnpublishBtn;
|
|
39
39
|
saveModalBtn;
|
|
40
40
|
documentTypeNode;
|
|
41
|
+
createDocumentBlueprintBtn;
|
|
41
42
|
constructor(page) {
|
|
42
43
|
super(page);
|
|
43
44
|
this.contentNameTxt = page.locator('#name-input input');
|
|
@@ -57,6 +58,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
57
58
|
this.menuItemTree = page.locator('umb-menu-item-tree-default');
|
|
58
59
|
this.confirmToUnpublishBtn = page.locator('umb-document-unpublish-modal').getByLabel('Unpublish');
|
|
59
60
|
this.documentTypeNode = page.locator('uui-ref-node-document-type');
|
|
61
|
+
this.createDocumentBlueprintBtn = page.getByLabel('Create Document Blueprint');
|
|
60
62
|
// Info tab
|
|
61
63
|
this.infoTab = page.getByRole('tab', { name: 'Info' });
|
|
62
64
|
this.linkContent = page.locator('.link-content');
|
|
@@ -143,6 +145,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
143
145
|
async clickConfirmToUnpublishButton() {
|
|
144
146
|
await this.confirmToUnpublishBtn.click();
|
|
145
147
|
}
|
|
148
|
+
async clickCreateDocumentBlueprintButton() {
|
|
149
|
+
await this.createDocumentBlueprintBtn.click();
|
|
150
|
+
}
|
|
146
151
|
// Info Tab
|
|
147
152
|
async clickInfoTab() {
|
|
148
153
|
await this.infoTab.click({ force: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ContentUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAEhD,MAAa,eAAgB,SAAQ,+BAAc;IAChC,cAAc,CAAU;IACxB,iBAAiB,CAAU;IAC3B,UAAU,CAAU;IACpB,UAAU,CAAU;IACpB,YAAY,CAAU;IACtB,uBAAuB,CAAU;IACjC,WAAW,CAAU;IACrB,aAAa,CAAU;IACvB,OAAO,CAAU;IACjB,WAAW,CAAU;IACrB,YAAY,CAAU;IACtB,WAAW,CAAU;IACrB,iBAAiB,CAAU;IAC3B,WAAW,CAAU;IACrB,mBAAmB,CAAU;IAC7B,cAAc,CAAU;IACxB,EAAE,CAAU;IACZ,sBAAsB,CAAU;IAChC,0BAA0B,CAAU;IACpC,eAAe,CAAU;IACzB,SAAS,CAAU;IACnB,yBAAyB,CAAU;IACnC,eAAe,CAAU;IACzB,0BAA0B,CAAU;IACpC,WAAW,CAAU;IACrB,eAAe,CAAU;IACzB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,YAAY,CAAU;IACtB,cAAc,CAAU;IACxB,qBAAqB,CAAU;IAC/B,YAAY,CAAU;I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playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class ContentUiHelper extends UiBaseLocators {\n private readonly contentNameTxt: Locator;\n private readonly saveAndPublishBtn: Locator;\n private readonly actionsBtn: Locator;\n private readonly publishBtn: Locator;\n private readonly unpublishBtn: Locator;\n private readonly actionMenuForContentBtn: Locator;\n private readonly openedModal: Locator;\n private readonly textstringTxt: Locator;\n private readonly infoTab: Locator;\n private readonly linkContent: Locator;\n private readonly historyItems: Locator;\n private readonly generalItem: Locator;\n private readonly publicationStatus: Locator;\n private readonly createdDate: Locator;\n private readonly editDocumentTypeBtn: Locator;\n private readonly addTemplateBtn: Locator;\n private readonly id: Locator;\n private readonly cultureAndHostnamesBtn: Locator;\n private readonly cultureLanguageDropdownBox: Locator;\n private readonly addNewDomainBtn: Locator;\n private readonly domainTxt: Locator;\n private readonly domainLanguageDropdownBox: Locator;\n private readonly deleteDomainBtn: Locator;\n private readonly reloadChildrenThreeDotsBtn: Locator;\n private readonly contentTree: Locator;\n private readonly richTextAreaTxt: Locator;\n private readonly textAreaTxt: Locator;\n private readonly plusIconBtn: Locator;\n private readonly enterTagTxt: Locator;\n private readonly menuItemTree: Locator;\n private readonly domainComboBox: Locator;\n private readonly confirmToUnpublishBtn: Locator;\n private readonly saveModalBtn: Locator;\n private readonly documentTypeNode: Locator;\n\n constructor(page: Page) {\n super(page);\n this.contentNameTxt = page.locator('#name-input input');\n this.saveAndPublishBtn = page.getByLabel('Save And Publish');\n this.actionsBtn = page.getByLabel('Actions', {exact: true});\n this.publishBtn = page.getByLabel('Publish', {exact: true});\n this.unpublishBtn = page.getByLabel('Unpublish', {exact: true});\n this.actionMenuForContentBtn = page.locator('#header [label=\"Open actions menu\"]');\n this.openedModal = page.locator('uui-modal-container[backdrop]');\n this.textstringTxt = page.locator('umb-property-editor-ui-text-box #input');\n this.reloadChildrenThreeDotsBtn = page.getByRole('button', {name: 'Reload children...'});\n this.contentTree = page.locator('umb-tree[alias=\"Umb.Tree.Document\"]');\n this.richTextAreaTxt = page.frameLocator('iframe[title=\"Rich Text Area\"]').locator('#tinymce');\n this.textAreaTxt = page.locator('umb-property-editor-ui-textarea textarea');\n this.plusIconBtn = page.locator('#icon-add svg');\n this.enterTagTxt = page.getByPlaceholder('Enter tag');\n this.menuItemTree = page.locator('umb-menu-item-tree-default');\n this.confirmToUnpublishBtn = page.locator('umb-document-unpublish-modal').getByLabel('Unpublish');\n this.documentTypeNode = page.locator('uui-ref-node-document-type');\n // Info tab\n this.infoTab = page.getByRole('tab', {name: 'Info'});\n this.linkContent = page.locator('.link-content');\n this.historyItems = page.locator('umb-history-item');\n this.generalItem = page.locator('.general-item');\n this.publicationStatus = this.generalItem.filter({hasText: 'Publication Status'}).locator('uui-tag');\n this.createdDate = this.generalItem.filter({hasText: 'Created'}).locator('umb-localize-date');\n this.editDocumentTypeBtn = this.generalItem.filter({hasText: 'Document Type'}).locator('#button');\n this.addTemplateBtn = this.generalItem.filter({hasText: 'Template'}).locator('#button');\n this.id = this.generalItem.filter({hasText: 'Id'}).locator('span');\n // Culure and Hostname\n this.cultureAndHostnamesBtn = page.getByLabel('Culture and Hostnames');\n this.cultureLanguageDropdownBox = page.locator('[headline=\"Culture\"]').getByLabel('combobox-input');\n this.addNewDomainBtn = page.getByLabel('Add new domain');\n this.domainTxt = page.getByLabel('Domain', { exact: true });\n this.domainLanguageDropdownBox = page.locator('[headline=\"Domains\"]').getByLabel('combobox-input');\n this.deleteDomainBtn = page.locator('[headline=\"Domains\"] [name=\"icon-trash\"] svg');\n this.domainComboBox = page.locator('#domains uui-combobox');\n this.saveModalBtn = this.sidebarModal.getByLabel('Save', {exact: true});\n }\n\n async enterContentName(name: string) {\n await expect(this.contentNameTxt).toBeVisible();\n await this.contentNameTxt.clear();\n await this.contentNameTxt.fill(name);\n }\n\n async clickSaveAndPublishButton() {\n await this.saveAndPublishBtn.click();\n }\n\n async clickActionsButton() {\n await this.actionsBtn.click();\n }\n\n async clickPublishButton() {\n await this.publishBtn.click();\n }\n\n async clickUnpublishButton() {\n await this.unpublishBtn.click();\n }\n\n async clickReloadChildrenThreeDotsButton() {\n await this.reloadChildrenThreeDotsBtn.click();\n }\n\n async clickActionsMenuAtRoot() {\n await this.actionMenuForContentBtn.click();\n }\n\n async openContent(contentName: string) {\n await this.menuItemTree.getByText(contentName, {exact: true}).click();\n }\n\n async clickActionsMenuForContent(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickCaretButtonForContentName(name: string) {\n await this.menuItemTree.filter({hasText: name}).last().locator('#caret-button').last().click();\n }\n\n async waitForModalVisible() {\n await this.openedModal.waitFor({state: 'attached'});\n }\n\n async waitForModalHidden() {\n await this.openedModal.waitFor({state: 'hidden'});\n }\n\n async enterTextstring(text: string) {\n await this.textstringTxt.clear();\n await this.textstringTxt.fill(text);\n }\n\n async doesContentTreeHaveName(contentName: string) {\n await expect(this.contentTree).toContainText(contentName);\n }\n\n async enterRichTextArea(value: string) {\n await expect(this.richTextAreaTxt).toBeVisible();\n await this.richTextAreaTxt.fill(value);\n }\n\n async enterTextArea(value: string) {\n await expect(this.textAreaTxt).toBeVisible();\n await this.textAreaTxt.fill(value);\n }\n\n async addTags(tagName: string) {\n await this.plusIconBtn.click();\n await this.enterTagTxt.fill(tagName);\n await this.enterTagTxt.press('Enter');\n }\n\n async addContentPicker(contentName: string) {\n await this.clickChooseButton();\n await this.sidebarModal.getByText(contentName).click();\n await this.chooseModalBtn.click();\n }\n\n async clickConfirmToUnpublishButton() {\n await this.confirmToUnpublishBtn.click();\n }\n\n // Info Tab\n async clickInfoTab() {\n await this.infoTab.click({force: true});\n }\n\n async doesLinkHaveText(text: string) {\n await expect(this.linkContent).toHaveText(text);\n }\n\n async doesHistoryHaveText(text: string) {\n await expect(this.historyItems).toHaveText(text);\n }\n\n async doesPublicationStatusHaveText(text: string) {\n await expect(this.publicationStatus).toHaveText(text);\n }\n\n async doesCreatedDateHaveText(text: string) {\n await expect(this.createdDate).toHaveText(text);\n }\n\n async doesIdHaveText(text: string) {\n await expect(this.id).toHaveText(text);\n }\n\n async clickEditDocumentTypeButton() {\n await this.editDocumentTypeBtn.click();\n }\n\n async clickAddTemplateButton() {\n await this.addTemplateBtn.click();\n }\n\n async clickDocumentTypeByName(documentTypeName:string) {\n await this.page.locator('uui-ref-node-document-type[name=\"' + documentTypeName + '\"]').click();\n }\n\n async clickTemplateByName(templateName:string) {\n await this.page.locator('uui-ref-node[name=\"' + templateName + '\"]').click();\n }\n\n async isDocumentTypeModalVisible(documentTypeName: string) {\n await expect(this.sidebarModal.locator('umb-document-type-workspace-editor [value=\"' + documentTypeName + '\"]')).toBeVisible();\n }\n\n async isTemplateModalVisible(templateName: string) {\n await expect(this.sidebarModal.getByText(templateName)).toBeVisible();\n }\n\n async clickEditTemplateByName(templateName:string) {\n await this.page.locator('uui-ref-node[name=\"' + templateName + '\"]').getByLabel('Choose').click();\n }\n\n async changeTemplate(oldTemplate: string, newTemplate: string) {\n await this.clickEditTemplateByName(oldTemplate);\n await this.sidebarModal.getByLabel(newTemplate).click();\n await this.chooseModalBtn.click();\n }\n\n async isTemplateNameDisabled(templateName:string) {\n await expect(this.sidebarModal.getByLabel(templateName)).toBeDisabled();\n }\n\n // Culture and Hostnames\n async clickCultureAndHostnamesButton() {\n await this.cultureAndHostnamesBtn.click();\n }\n\n async selectCultureLanguageOption(option: string) {\n await this.cultureLanguageDropdownBox.click();\n await this.page.getByText(option).click();\n }\n\n async selectDomainLanguageOption(option: string, index: number = 0) {\n await this.domainLanguageDropdownBox.nth(index).click();\n await this.domainComboBox.nth(index).getByText(option).click();\n }\n\n async clickAddNewDomainButton() {\n await this.addNewDomainBtn.click();\n }\n\n async enterDomain(value: string, index: number = 0) {\n await this.domainTxt.nth(index).clear();\n await this.domainTxt.nth(index).fill(value);\n }\n\n async clickDeleteDomainButton() {\n await this.deleteDomainBtn.first().click();\n }\n\n async clickSaveModalButton() {\n await this.saveModalBtn.click();\n }\n\n async chooseDocumentType(documentTypeName: string) {\n await this.documentTypeNode.filter({hasText: documentTypeName}).click();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ContentUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAEhD,MAAa,eAAgB,SAAQ,+BAAc;IAChC,cAAc,CAAU;IACxB,iBAAiB,CAAU;IAC3B,UAAU,CAAU;IACpB,UAAU,CAAU;IACpB,YAAY,CAAU;IACtB,uBAAuB,CAAU;IACjC,WAAW,CAAU;IACrB,aAAa,CAAU;IACvB,OAAO,CAAU;IACjB,WAAW,CAAU;IACrB,YAAY,CAAU;IACtB,WAAW,CAAU;IACrB,iBAAiB,CAAU;IAC3B,WAAW,CAAU;IACrB,mBAAmB,CAAU;IAC7B,cAAc,CAAU;IACxB,EAAE,CAAU;IACZ,sBAAsB,CAAU;IAChC,0BAA0B,CAAU;IACpC,eAAe,CAAU;IACzB,SAAS,CAAU;IACnB,yBAAyB,CAAU;IACnC,eAAe,CAAU;IACzB,0BAA0B,CAAU;IACpC,WAAW,CAAU;IACrB,eAAe,CAAU;IACzB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,YAAY,CAAU;IACtB,cAAc,CAAU;IACxB,qBAAqB,CAAU;IAC/B,YAAY,CAAU;IACtB,gBAAgB,CAAU;IAC1B,0BAA0B,CAAU;IAErD,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QACxD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UA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AK,CAAC,0BAA0B,CAAC,MAAc,EAAE,QAAgB,CAAC;QAChE,MAAM,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QACxD,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE,QAAgB,CAAC;QAChD,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QACxC,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,gBAAwB;QAC/C,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1E,CAAC;CACF;AAzQD,0CAyQC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class ContentUiHelper extends UiBaseLocators {\n private readonly contentNameTxt: Locator;\n private readonly saveAndPublishBtn: Locator;\n private readonly actionsBtn: Locator;\n private readonly publishBtn: Locator;\n private readonly unpublishBtn: Locator;\n private readonly actionMenuForContentBtn: Locator;\n private readonly openedModal: Locator;\n private readonly textstringTxt: Locator;\n private readonly infoTab: Locator;\n private readonly linkContent: Locator;\n private readonly historyItems: Locator;\n private readonly generalItem: Locator;\n private readonly publicationStatus: Locator;\n private readonly createdDate: Locator;\n private readonly editDocumentTypeBtn: Locator;\n private readonly addTemplateBtn: Locator;\n private readonly id: Locator;\n private readonly cultureAndHostnamesBtn: Locator;\n private readonly cultureLanguageDropdownBox: Locator;\n private readonly addNewDomainBtn: Locator;\n private readonly domainTxt: Locator;\n private readonly domainLanguageDropdownBox: Locator;\n private readonly deleteDomainBtn: Locator;\n private readonly reloadChildrenThreeDotsBtn: Locator;\n private readonly contentTree: Locator;\n private readonly richTextAreaTxt: Locator;\n private readonly textAreaTxt: Locator;\n private readonly plusIconBtn: Locator;\n private readonly enterTagTxt: Locator;\n private readonly menuItemTree: Locator;\n private readonly domainComboBox: Locator;\n private readonly confirmToUnpublishBtn: Locator;\n private readonly saveModalBtn: Locator;\n private readonly documentTypeNode: Locator;\n private readonly createDocumentBlueprintBtn: Locator;\n\n constructor(page: Page) {\n super(page);\n this.contentNameTxt = page.locator('#name-input input');\n this.saveAndPublishBtn = page.getByLabel('Save And Publish');\n this.actionsBtn = page.getByLabel('Actions', {exact: true});\n this.publishBtn = page.getByLabel('Publish', {exact: true});\n this.unpublishBtn = page.getByLabel('Unpublish', {exact: true});\n this.actionMenuForContentBtn = page.locator('#header [label=\"Open actions menu\"]');\n this.openedModal = page.locator('uui-modal-container[backdrop]');\n this.textstringTxt = page.locator('umb-property-editor-ui-text-box #input');\n this.reloadChildrenThreeDotsBtn = page.getByRole('button', {name: 'Reload children...'});\n this.contentTree = page.locator('umb-tree[alias=\"Umb.Tree.Document\"]');\n this.richTextAreaTxt = page.frameLocator('iframe[title=\"Rich Text Area\"]').locator('#tinymce');\n this.textAreaTxt = page.locator('umb-property-editor-ui-textarea textarea');\n this.plusIconBtn = page.locator('#icon-add svg');\n this.enterTagTxt = page.getByPlaceholder('Enter tag');\n this.menuItemTree = page.locator('umb-menu-item-tree-default');\n this.confirmToUnpublishBtn = page.locator('umb-document-unpublish-modal').getByLabel('Unpublish');\n this.documentTypeNode = page.locator('uui-ref-node-document-type');\n this.createDocumentBlueprintBtn = page.getByLabel('Create Document Blueprint');\n // Info tab\n this.infoTab = page.getByRole('tab', {name: 'Info'});\n this.linkContent = page.locator('.link-content');\n this.historyItems = page.locator('umb-history-item');\n this.generalItem = page.locator('.general-item');\n this.publicationStatus = this.generalItem.filter({hasText: 'Publication Status'}).locator('uui-tag');\n this.createdDate = this.generalItem.filter({hasText: 'Created'}).locator('umb-localize-date');\n this.editDocumentTypeBtn = this.generalItem.filter({hasText: 'Document Type'}).locator('#button');\n this.addTemplateBtn = this.generalItem.filter({hasText: 'Template'}).locator('#button');\n this.id = this.generalItem.filter({hasText: 'Id'}).locator('span');\n // Culure and Hostname\n this.cultureAndHostnamesBtn = page.getByLabel('Culture and Hostnames');\n this.cultureLanguageDropdownBox = page.locator('[headline=\"Culture\"]').getByLabel('combobox-input');\n this.addNewDomainBtn = page.getByLabel('Add new domain');\n this.domainTxt = page.getByLabel('Domain', { exact: true });\n this.domainLanguageDropdownBox = page.locator('[headline=\"Domains\"]').getByLabel('combobox-input');\n this.deleteDomainBtn = page.locator('[headline=\"Domains\"] [name=\"icon-trash\"] svg');\n this.domainComboBox = page.locator('#domains uui-combobox');\n this.saveModalBtn = this.sidebarModal.getByLabel('Save', {exact: true});\n }\n\n async enterContentName(name: string) {\n await expect(this.contentNameTxt).toBeVisible();\n await this.contentNameTxt.clear();\n await this.contentNameTxt.fill(name);\n }\n\n async clickSaveAndPublishButton() {\n await this.saveAndPublishBtn.click();\n }\n\n async clickActionsButton() {\n await this.actionsBtn.click();\n }\n\n async clickPublishButton() {\n await this.publishBtn.click();\n }\n\n async clickUnpublishButton() {\n await this.unpublishBtn.click();\n }\n\n async clickReloadChildrenThreeDotsButton() {\n await this.reloadChildrenThreeDotsBtn.click();\n }\n\n async clickActionsMenuAtRoot() {\n await this.actionMenuForContentBtn.click();\n }\n\n async openContent(contentName: string) {\n await this.menuItemTree.getByText(contentName, {exact: true}).click();\n }\n\n async clickActionsMenuForContent(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickCaretButtonForContentName(name: string) {\n await this.menuItemTree.filter({hasText: name}).last().locator('#caret-button').last().click();\n }\n\n async waitForModalVisible() {\n await this.openedModal.waitFor({state: 'attached'});\n }\n\n async waitForModalHidden() {\n await this.openedModal.waitFor({state: 'hidden'});\n }\n\n async enterTextstring(text: string) {\n await this.textstringTxt.clear();\n await this.textstringTxt.fill(text);\n }\n\n async doesContentTreeHaveName(contentName: string) {\n await expect(this.contentTree).toContainText(contentName);\n }\n\n async enterRichTextArea(value: string) {\n await expect(this.richTextAreaTxt).toBeVisible();\n await this.richTextAreaTxt.fill(value);\n }\n\n async enterTextArea(value: string) {\n await expect(this.textAreaTxt).toBeVisible();\n await this.textAreaTxt.fill(value);\n }\n\n async addTags(tagName: string) {\n await this.plusIconBtn.click();\n await this.enterTagTxt.fill(tagName);\n await this.enterTagTxt.press('Enter');\n }\n\n async addContentPicker(contentName: string) {\n await this.clickChooseButton();\n await this.sidebarModal.getByText(contentName).click();\n await this.chooseModalBtn.click();\n }\n\n async clickConfirmToUnpublishButton() {\n await this.confirmToUnpublishBtn.click();\n }\n\n async clickCreateDocumentBlueprintButton() {\n await this.createDocumentBlueprintBtn.click();\n }\n\n // Info Tab\n async clickInfoTab() {\n await this.infoTab.click({force: true});\n }\n\n async doesLinkHaveText(text: string) {\n await expect(this.linkContent).toHaveText(text);\n }\n\n async doesHistoryHaveText(text: string) {\n await expect(this.historyItems).toHaveText(text);\n }\n\n async doesPublicationStatusHaveText(text: string) {\n await expect(this.publicationStatus).toHaveText(text);\n }\n\n async doesCreatedDateHaveText(text: string) {\n await expect(this.createdDate).toHaveText(text);\n }\n\n async doesIdHaveText(text: string) {\n await expect(this.id).toHaveText(text);\n }\n\n async clickEditDocumentTypeButton() {\n await this.editDocumentTypeBtn.click();\n }\n\n async clickAddTemplateButton() {\n await this.addTemplateBtn.click();\n }\n\n async clickDocumentTypeByName(documentTypeName:string) {\n await this.page.locator('uui-ref-node-document-type[name=\"' + documentTypeName + '\"]').click();\n }\n\n async clickTemplateByName(templateName:string) {\n await this.page.locator('uui-ref-node[name=\"' + templateName + '\"]').click();\n }\n\n async isDocumentTypeModalVisible(documentTypeName: string) {\n await expect(this.sidebarModal.locator('umb-document-type-workspace-editor [value=\"' + documentTypeName + '\"]')).toBeVisible();\n }\n\n async isTemplateModalVisible(templateName: string) {\n await expect(this.sidebarModal.getByText(templateName)).toBeVisible();\n }\n\n async clickEditTemplateByName(templateName:string) {\n await this.page.locator('uui-ref-node[name=\"' + templateName + '\"]').getByLabel('Choose').click();\n }\n\n async changeTemplate(oldTemplate: string, newTemplate: string) {\n await this.clickEditTemplateByName(oldTemplate);\n await this.sidebarModal.getByLabel(newTemplate).click();\n await this.chooseModalBtn.click();\n }\n\n async isTemplateNameDisabled(templateName:string) {\n await expect(this.sidebarModal.getByLabel(templateName)).toBeDisabled();\n }\n\n // Culture and Hostnames\n async clickCultureAndHostnamesButton() {\n await this.cultureAndHostnamesBtn.click();\n }\n\n async selectCultureLanguageOption(option: string) {\n await this.cultureLanguageDropdownBox.click();\n await this.page.getByText(option).click();\n }\n\n async selectDomainLanguageOption(option: string, index: number = 0) {\n await this.domainLanguageDropdownBox.nth(index).click();\n await this.domainComboBox.nth(index).getByText(option).click();\n }\n\n async clickAddNewDomainButton() {\n await this.addNewDomainBtn.click();\n }\n\n async enterDomain(value: string, index: number = 0) {\n await this.domainTxt.nth(index).clear();\n await this.domainTxt.nth(index).fill(value);\n }\n\n async clickDeleteDomainButton() {\n await this.deleteDomainBtn.first().click();\n }\n\n async clickSaveModalButton() {\n await this.saveModalBtn.click();\n }\n\n async chooseDocumentType(documentTypeName: string) {\n await this.documentTypeNode.filter({hasText: documentTypeName}).click();\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiHelpers } from "./ApiHelpers";
|
|
2
|
+
export declare class DocumentBlueprintApiHelper {
|
|
3
|
+
api: ApiHelpers;
|
|
4
|
+
constructor(api: ApiHelpers);
|
|
5
|
+
get(id: string): Promise<any>;
|
|
6
|
+
doesExist(id: string): Promise<boolean>;
|
|
7
|
+
create(documentBlueprint: any): Promise<string | undefined>;
|
|
8
|
+
delete(id: string): Promise<number | undefined>;
|
|
9
|
+
update(id: string, documentBlueprint: any): Promise<import("playwright-core").APIResponse | undefined>;
|
|
10
|
+
getAllAtRoot(): Promise<import("playwright-core").APIResponse>;
|
|
11
|
+
getChildren(id: string): Promise<any>;
|
|
12
|
+
doesNameExist(name: string): Promise<any>;
|
|
13
|
+
private recurseDeleteChildren;
|
|
14
|
+
private recurseChildren;
|
|
15
|
+
getByName(name: string): Promise<any>;
|
|
16
|
+
ensureNameNotExists(name: string): Promise<void>;
|
|
17
|
+
createDefaultDocumentBlueprint(documentBlueprintName: string, documentTypeId: string): Promise<string | undefined>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentBlueprintApiHelper = void 0;
|
|
4
|
+
const json_models_builders_1 = require("@umbraco/json-models-builders");
|
|
5
|
+
class DocumentBlueprintApiHelper {
|
|
6
|
+
api;
|
|
7
|
+
constructor(api) {
|
|
8
|
+
this.api = api;
|
|
9
|
+
}
|
|
10
|
+
async get(id) {
|
|
11
|
+
const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);
|
|
12
|
+
return await response.json();
|
|
13
|
+
}
|
|
14
|
+
async doesExist(id) {
|
|
15
|
+
const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);
|
|
16
|
+
return response.status() === 200;
|
|
17
|
+
}
|
|
18
|
+
async create(documentBlueprint) {
|
|
19
|
+
if (documentBlueprint == null) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint', documentBlueprint);
|
|
23
|
+
return response.headers().location.split("v1/document-blueprint/").pop();
|
|
24
|
+
}
|
|
25
|
+
async delete(id) {
|
|
26
|
+
if (id == null) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const response = await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);
|
|
30
|
+
return response.status();
|
|
31
|
+
}
|
|
32
|
+
async update(id, documentBlueprint) {
|
|
33
|
+
if (documentBlueprint == null) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id, documentBlueprint);
|
|
37
|
+
}
|
|
38
|
+
async getAllAtRoot() {
|
|
39
|
+
return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/document-blueprint/root?skip=0&take=1000&foldersOnly=false');
|
|
40
|
+
}
|
|
41
|
+
async getChildren(id) {
|
|
42
|
+
const response = await this.api.get(`${this.api.baseUrl}/umbraco/management/api/v1/tree/document-blueprint/children?parentId=${id}&skip=0&take=10000&foldersOnly=false`);
|
|
43
|
+
const items = await response.json();
|
|
44
|
+
return items.items;
|
|
45
|
+
}
|
|
46
|
+
async doesNameExist(name) {
|
|
47
|
+
return await this.getByName(name);
|
|
48
|
+
}
|
|
49
|
+
async recurseDeleteChildren(id) {
|
|
50
|
+
const items = await this.getChildren(id);
|
|
51
|
+
for (const child of items) {
|
|
52
|
+
if (child.hasChildren) {
|
|
53
|
+
await this.recurseDeleteChildren(child.id);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
await this.delete(child.id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return await this.delete(id);
|
|
60
|
+
}
|
|
61
|
+
async recurseChildren(name, id, toDelete) {
|
|
62
|
+
const items = await this.getChildren(id);
|
|
63
|
+
for (const child of items) {
|
|
64
|
+
if (child.name === name) {
|
|
65
|
+
if (!toDelete) {
|
|
66
|
+
return await this.get(child.id);
|
|
67
|
+
}
|
|
68
|
+
if (child.hasChildren) {
|
|
69
|
+
return await this.recurseDeleteChildren(child.id);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return await this.delete(child.id);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (child.hasChildren) {
|
|
76
|
+
await this.recurseChildren(name, child.id, toDelete);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
async getByName(name) {
|
|
82
|
+
const rootDocumentBlueprints = await this.getAllAtRoot();
|
|
83
|
+
const jsonDocumentBlueprints = await rootDocumentBlueprints.json();
|
|
84
|
+
for (const blueprint of jsonDocumentBlueprints.items) {
|
|
85
|
+
if (blueprint.name === name) {
|
|
86
|
+
return this.get(blueprint.id);
|
|
87
|
+
}
|
|
88
|
+
else if (blueprint.hasChildren) {
|
|
89
|
+
const result = await this.recurseChildren(name, blueprint.id, false);
|
|
90
|
+
if (result) {
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
async ensureNameNotExists(name) {
|
|
98
|
+
const rootDocumentBlueprints = await this.getAllAtRoot();
|
|
99
|
+
const jsonDocumentBlueprints = await rootDocumentBlueprints.json();
|
|
100
|
+
for (const blueprint of jsonDocumentBlueprints.items) {
|
|
101
|
+
if (blueprint.name === name) {
|
|
102
|
+
if (blueprint.hasChildren) {
|
|
103
|
+
await this.recurseDeleteChildren(blueprint.id);
|
|
104
|
+
}
|
|
105
|
+
await this.delete(blueprint.id);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if (blueprint.hasChildren) {
|
|
109
|
+
await this.recurseChildren(name, blueprint.id, true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async createDefaultDocumentBlueprint(documentBlueprintName, documentTypeId) {
|
|
115
|
+
await this.ensureNameNotExists(documentBlueprintName);
|
|
116
|
+
const document = new json_models_builders_1.DocumentBlueprintsBuilder()
|
|
117
|
+
.withDocumentTypeId(documentTypeId)
|
|
118
|
+
.addVariant()
|
|
119
|
+
.withName(documentBlueprintName)
|
|
120
|
+
.done()
|
|
121
|
+
.build();
|
|
122
|
+
return await this.create(document);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.DocumentBlueprintApiHelper = DocumentBlueprintApiHelper;
|
|
126
|
+
//# sourceMappingURL=DocumentBlueprintApiHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentBlueprintApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentBlueprintApiHelper.ts"],"names":[],"mappings":";;;AACA,wEAAwE;AAExE,MAAa,0BAA0B;IACrC,GAAG,CAAa;IAEhB,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,gDAAgD,GAAG,EAAE,CAAC,CAAC;QAC9G,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,EAAU;QACxB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,gDAAgD,GAAG,EAAE,CAAC,CAAC;QAC9G,OAAO,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,iBAAiB;QAC5B,IAAI,iBAAiB,IAAI,IAAI,EAAE;YA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ACH,CAAC;IAED,KAAK,CAAC,8BAA8B,CAAC,qBAA6B,EAAE,cAAsB;QACxF,MAAM,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,IAAI,gDAAyB,EAAE;aAC7C,kBAAkB,CAAC,cAAc,CAAC;aAClC,UAAU,EAAE;aACV,QAAQ,CAAC,qBAAqB,CAAC;aAC/B,IAAI,EAAE;aACR,KAAK,EAAE,CAAC;QACX,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;CACF;AApID,gEAoIC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\nimport {DocumentBlueprintsBuilder} from \"@umbraco/json-models-builders\";\n\nexport class DocumentBlueprintApiHelper {\n api: ApiHelpers;\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);\n return await response.json();\n }\n\n async doesExist(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);\n return response.status() === 200;\n }\n\n async create(documentBlueprint) {\n if (documentBlueprint == null) {\n return;\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint', documentBlueprint);\n return response.headers().location.split(\"v1/document-blueprint/\").pop();\n }\n\n async delete(id: string) {\n if (id == null) {\n return;\n }\n const response = await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id);\n return response.status();\n }\n\n async update(id: string, documentBlueprint) {\n if (documentBlueprint == null) {\n return;\n }\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/document-blueprint/' + id, documentBlueprint);\n }\n\n async getAllAtRoot() {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/document-blueprint/root?skip=0&take=1000&foldersOnly=false');\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(`${this.api.baseUrl}/umbraco/management/api/v1/tree/document-blueprint/children?parentId=${id}&skip=0&take=10000&foldersOnly=false`);\n const items = await response.json();\n return items.items;\n }\n\n async doesNameExist(name: string) {\n return await this.getByName(name);\n }\n\n private async recurseDeleteChildren(id: string) {\n const items = await this.getChildren(id);\n\n for (const child of items) {\n if (child.hasChildren) {\n await this.recurseDeleteChildren(child.id);\n } else {\n await this.delete(child.id);\n }\n }\n return await this.delete(id);\n }\n\n private async recurseChildren(name: string, id: string, toDelete: boolean) {\n const items = await this.getChildren(id);\n\n for (const child of items) {\n if (child.name === name) {\n if (!toDelete) {\n return await this.get(child.id);\n }\n if (child.hasChildren) {\n return await this.recurseDeleteChildren(child.id);\n } else {\n return await this.delete(child.id);\n }\n } else if (child.hasChildren) {\n await this.recurseChildren(name, child.id, toDelete);\n }\n }\n return false;\n }\n\n async getByName(name: string) {\n const rootDocumentBlueprints = await this.getAllAtRoot();\n const jsonDocumentBlueprints = await rootDocumentBlueprints.json();\n\n for (const blueprint of jsonDocumentBlueprints.items) {\n if (blueprint.name === name) {\n return this.get(blueprint.id);\n } else if (blueprint.hasChildren) {\n const result = await this.recurseChildren(name, blueprint.id, false);\n if (result) {\n return result;\n }\n }\n }\n return false;\n }\n\n async ensureNameNotExists(name: string) {\n const rootDocumentBlueprints = await this.getAllAtRoot();\n const jsonDocumentBlueprints = await rootDocumentBlueprints.json();\n\n for (const blueprint of jsonDocumentBlueprints.items) {\n if (blueprint.name === name) {\n if (blueprint.hasChildren) {\n await this.recurseDeleteChildren(blueprint.id);\n }\n await this.delete(blueprint.id);\n } else {\n if (blueprint.hasChildren) {\n await this.recurseChildren(name, blueprint.id, true);\n }\n }\n }\n }\n\n async createDefaultDocumentBlueprint(documentBlueprintName: string, documentTypeId: string) {\n await this.ensureNameNotExists(documentBlueprintName);\n const document = new DocumentBlueprintsBuilder()\n .withDocumentTypeId(documentTypeId)\n .addVariant()\n .withName(documentBlueprintName)\n .done()\n .build();\n return await this.create(document);\n }\n} "]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Page } from "@playwright/test";
|
|
2
|
+
import { UiBaseLocators } from "./UiBaseLocators";
|
|
3
|
+
export declare class DocumentBlueprintUiHelper extends UiBaseLocators {
|
|
4
|
+
private readonly documentBlueprintTree;
|
|
5
|
+
private readonly createDocumentBlueprintBtn;
|
|
6
|
+
private readonly documentBlueprintNameTxt;
|
|
7
|
+
private readonly deleteMenu;
|
|
8
|
+
constructor(page: Page);
|
|
9
|
+
clickActionsMenuForDocumentBlueprints(name: string): Promise<void>;
|
|
10
|
+
clickActionsMenuAtRoot(): Promise<void>;
|
|
11
|
+
clickRootFolderCaretButton(): Promise<void>;
|
|
12
|
+
reloadDocumentBlueprintsTree(): Promise<void>;
|
|
13
|
+
goToDocumentBlueprint(blueprintName: string): Promise<void>;
|
|
14
|
+
isDocumentBlueprintRootTreeItemVisible(blueprintName: string, isVisible?: boolean, toReload?: boolean): Promise<void>;
|
|
15
|
+
clickCreateDocumentBlueprintButton(): Promise<void>;
|
|
16
|
+
enterDocumentBlueprintName(blueprintName: string): Promise<void>;
|
|
17
|
+
clickDeleteMenuButton(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentBlueprintUiHelper = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const UiBaseLocators_1 = require("./UiBaseLocators");
|
|
6
|
+
const ConstantHelper_1 = require("./ConstantHelper");
|
|
7
|
+
class DocumentBlueprintUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
8
|
+
documentBlueprintTree;
|
|
9
|
+
createDocumentBlueprintBtn;
|
|
10
|
+
documentBlueprintNameTxt;
|
|
11
|
+
deleteMenu;
|
|
12
|
+
constructor(page) {
|
|
13
|
+
super(page);
|
|
14
|
+
this.documentBlueprintTree = page.locator('umb-tree[alias="Umb.Tree.DocumentBlueprint"]');
|
|
15
|
+
this.createDocumentBlueprintBtn = page.getByLabel('Create Document Blueprint');
|
|
16
|
+
this.documentBlueprintNameTxt = page.locator('#name-input #input');
|
|
17
|
+
this.deleteMenu = page.locator('umb-section-sidebar #menu-item').getByLabel('Delete');
|
|
18
|
+
}
|
|
19
|
+
async clickActionsMenuForDocumentBlueprints(name) {
|
|
20
|
+
await this.clickActionsMenuForName(name);
|
|
21
|
+
}
|
|
22
|
+
async clickActionsMenuAtRoot() {
|
|
23
|
+
await this.clickActionsMenuForDocumentBlueprints('Document Blueprints');
|
|
24
|
+
}
|
|
25
|
+
async clickRootFolderCaretButton() {
|
|
26
|
+
await this.clickCaretButtonForName('Document Blueprints');
|
|
27
|
+
}
|
|
28
|
+
async reloadDocumentBlueprintsTree() {
|
|
29
|
+
await this.reloadTree('Document Blueprints');
|
|
30
|
+
}
|
|
31
|
+
async goToDocumentBlueprint(blueprintName) {
|
|
32
|
+
await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
|
|
33
|
+
await this.reloadDocumentBlueprintsTree();
|
|
34
|
+
await this.page.getByLabel(blueprintName).click({ force: true });
|
|
35
|
+
}
|
|
36
|
+
async isDocumentBlueprintRootTreeItemVisible(blueprintName, isVisible = true, toReload = true) {
|
|
37
|
+
if (toReload) {
|
|
38
|
+
await this.reloadDocumentBlueprintsTree();
|
|
39
|
+
}
|
|
40
|
+
return (0, test_1.expect)(this.documentBlueprintTree.getByText(blueprintName, { exact: true })).toBeVisible({ visible: isVisible });
|
|
41
|
+
}
|
|
42
|
+
async clickCreateDocumentBlueprintButton() {
|
|
43
|
+
await this.createDocumentBlueprintBtn.click();
|
|
44
|
+
}
|
|
45
|
+
async enterDocumentBlueprintName(blueprintName) {
|
|
46
|
+
await (0, test_1.expect)(this.documentBlueprintNameTxt).toBeVisible();
|
|
47
|
+
await this.documentBlueprintNameTxt.fill(blueprintName);
|
|
48
|
+
}
|
|
49
|
+
async clickDeleteMenuButton() {
|
|
50
|
+
await this.deleteMenu.click();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.DocumentBlueprintUiHelper = DocumentBlueprintUiHelper;
|
|
54
|
+
//# sourceMappingURL=DocumentBlueprintUiHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentBlueprintUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentBlueprintUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,qDAAgD;AAChD,qDAAgD;AAEhD,MAAa,yBAA0B,SAAQ,+BAAc;IAC1C,qBAAqB,CAAU;IAC/B,0BAA0B,CAAU;IACpC,wBAAwB,CAAU;IAClC,UAAU,CAAU;IAErC,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;QAC1F,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QAC/E,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,qCAAqC,CAAC,IAAY;QACtD,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,IAAI,CAAC,qCAAqC,CAAC,qBAAqB,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,0BAA0B;QAC9B,MAAM,IAAI,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,4BAA4B;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,aAAqB;QAC/C,MAAM,IAAI,CAAC,WAAW,CAAC,+BAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAC1C,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,sCAAsC,CAAC,aAAqB,EAAE,YAAqB,IAAI,EAAE,WAAoB,IAAI;QACrH,IAAI,QAAQ,EAAE;YACZ,MAAM,IAAI,CAAC,4BAA4B,EAAE,CAAC;SAC3C;QACD,OAAO,IAAA,aAAM,EAAC,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,aAAa,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC;IACtH,CAAC;IAED,KAAK,CAAC,kCAAkC;QACtC,MAAM,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,0BAA0B,CAAC,aAAqB;QACpD,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;CACF;AAvDD,8DAuDC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\"\nimport {UiBaseLocators} from \"./UiBaseLocators\";\nimport {ConstantHelper} from \"./ConstantHelper\";\n\nexport class DocumentBlueprintUiHelper extends UiBaseLocators{\n private readonly documentBlueprintTree: Locator;\n private readonly createDocumentBlueprintBtn: Locator;\n private readonly documentBlueprintNameTxt: Locator;\n private readonly deleteMenu: Locator;\n\n constructor(page: Page) {\n super(page);\n this.documentBlueprintTree = page.locator('umb-tree[alias=\"Umb.Tree.DocumentBlueprint\"]');\n this.createDocumentBlueprintBtn = page.getByLabel('Create Document Blueprint');\n this.documentBlueprintNameTxt = page.locator('#name-input #input');\n this.deleteMenu = page.locator('umb-section-sidebar #menu-item').getByLabel('Delete');\n }\n\n async clickActionsMenuForDocumentBlueprints(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickActionsMenuAtRoot() {\n await this.clickActionsMenuForDocumentBlueprints('Document Blueprints');\n }\n\n async clickRootFolderCaretButton() {\n await this.clickCaretButtonForName('Document Blueprints');\n }\n\n async reloadDocumentBlueprintsTree() {\n await this.reloadTree('Document Blueprints');\n }\n \n async goToDocumentBlueprint(blueprintName: string) {\n await this.goToSection(ConstantHelper.sections.settings);\n await this.reloadDocumentBlueprintsTree();\n await this.page.getByLabel(blueprintName).click({force: true});\n }\n\n async isDocumentBlueprintRootTreeItemVisible(blueprintName: string, isVisible: boolean = true, toReload: boolean = true){\n if (toReload) {\n await this.reloadDocumentBlueprintsTree();\n }\n return expect(this.documentBlueprintTree.getByText(blueprintName, {exact: true})).toBeVisible({visible: isVisible});\n }\n\n async clickCreateDocumentBlueprintButton() {\n await this.createDocumentBlueprintBtn.click();\n }\n\n async enterDocumentBlueprintName(blueprintName: string) {\n await expect(this.documentBlueprintNameTxt).toBeVisible();\n await this.documentBlueprintNameTxt.fill(blueprintName);\n }\n\n async clickDeleteMenuButton() {\n await this.deleteMenu.click();\n }\n}"]}
|
|
@@ -15,5 +15,5 @@ export declare class PartialViewUiHelper extends UiBaseLocators {
|
|
|
15
15
|
enterPartialViewContent(partialViewContent: string): Promise<void>;
|
|
16
16
|
openPartialViewAtRoot(partialViewName: string): Promise<void>;
|
|
17
17
|
reloadPartialViewTree(): Promise<void>;
|
|
18
|
-
isPartialViewRootTreeItemVisibile(partialView: string, isVisible?: boolean): Promise<void>;
|
|
18
|
+
isPartialViewRootTreeItemVisibile(partialView: string, isVisible?: boolean, toReload?: boolean): Promise<void>;
|
|
19
19
|
}
|
|
@@ -48,8 +48,10 @@ class PartialViewUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
48
48
|
async reloadPartialViewTree() {
|
|
49
49
|
await this.reloadTree('Partial Views');
|
|
50
50
|
}
|
|
51
|
-
async isPartialViewRootTreeItemVisibile(partialView, isVisible = true) {
|
|
52
|
-
|
|
51
|
+
async isPartialViewRootTreeItemVisibile(partialView, isVisible = true, toReload = true) {
|
|
52
|
+
if (toReload) {
|
|
53
|
+
await this.reloadPartialViewTree();
|
|
54
|
+
}
|
|
53
55
|
return (0, test_1.expect)(this.partialViewTree.getByText(partialView, { exact: true })).toBeVisible({ visible: isVisible });
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartialViewUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/PartialViewUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,qDAAgD;AAEhD,MAAa,mBAAoB,SAAQ,+BAAc;IACpC,sBAAsB,CAAU;IAChC,4BAA4B,CAAU;IACtC,kBAAkB,CAAU;IAC5B,eAAe,CAAU;IAE1C,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;QACxE,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;QACxF,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,8BAA8B,CAA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, Locator, expect} from \"@playwright/test\"\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class PartialViewUiHelper extends UiBaseLocators{\n private readonly newEmptyPartialViewBtn: Locator;\n private readonly newPartialViewFromSnippetBtn: Locator;\n private readonly partialViewNameTxt: Locator;\n private readonly partialViewTree: Locator;\n\n constructor(page: Page) {\n super(page);\n this.newEmptyPartialViewBtn = page.getByLabel('New empty partial view');\n this.newPartialViewFromSnippetBtn = page.getByLabel('New partial view from snippet...');\n this.partialViewNameTxt = page.getByLabel('Partial view name');\n this.partialViewTree = page.locator('umb-tree[alias=\"Umb.Tree.PartialView\"]');\n }\n\n async clickActionsMenuForPartialView(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickActionsMenuAtRoot() {\n await this.clickActionsMenuForPartialView('Partial Views');\n }\n\n async clickRootFolderCaretButton() {\n await this.clickCaretButtonForName('Partial Views');\n }\n\n async clickNewEmptyPartialViewButton() {\n await this.newEmptyPartialViewBtn.click();\n }\n\n async clickNewPartialViewFromSnippetButton() {\n await this.newPartialViewFromSnippetBtn.click();\n }\n\n async enterPartialViewName(partialViewName: string) {\n await expect(this.partialViewNameTxt).toBeVisible();\n await this.partialViewNameTxt.click();\n await this.partialViewNameTxt.clear();\n await this.partialViewNameTxt.fill(partialViewName);\n }\n\n async enterPartialViewContent(partialViewContent: string) {\n await this.textAreaInputArea.clear();\n await this.textAreaInputArea.fill(partialViewContent);\n }\n\n async openPartialViewAtRoot(partialViewName: string) {\n await this.reloadPartialViewTree();\n await this.page.getByLabel(partialViewName).click();\n await expect(this.partialViewNameTxt).toBeVisible();\n }\n\n async reloadPartialViewTree() {\n await this.reloadTree('Partial Views');\n }\n\n async isPartialViewRootTreeItemVisibile(partialView: string, isVisible: boolean = true, toReload: boolean = true){\n if (toReload) {\n await this.reloadPartialViewTree();\n }\n return expect(this.partialViewTree.getByText(partialView, {exact: true})).toBeVisible({visible: isVisible});\n }\n}"]}
|
|
@@ -14,5 +14,5 @@ export declare class ScriptUiHelper extends UiBaseLocators {
|
|
|
14
14
|
enterScriptContent(scriptContent: string): Promise<void>;
|
|
15
15
|
openScriptAtRoot(scriptName: string): Promise<void>;
|
|
16
16
|
reloadScriptTree(): Promise<void>;
|
|
17
|
-
isScriptRootTreeItemVisible(scriptName: string, isVisible?: boolean): Promise<void>;
|
|
17
|
+
isScriptRootTreeItemVisible(scriptName: string, isVisible?: boolean, toReload?: boolean): Promise<void>;
|
|
18
18
|
}
|
|
@@ -48,8 +48,10 @@ class ScriptUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
48
48
|
async reloadScriptTree() {
|
|
49
49
|
await this.reloadTree('Scripts');
|
|
50
50
|
}
|
|
51
|
-
async isScriptRootTreeItemVisible(scriptName, isVisible = true) {
|
|
52
|
-
|
|
51
|
+
async isScriptRootTreeItemVisible(scriptName, isVisible = true, toReload = true) {
|
|
52
|
+
if (toReload) {
|
|
53
|
+
await this.reloadScriptTree();
|
|
54
|
+
}
|
|
53
55
|
return (0, test_1.expect)(this.scriptTree.getByText(scriptName, { exact: true })).toBeVisible({ visible: isVisible });
|
|
54
56
|
}
|
|
55
57
|
}
|