@umbraco/playwright-testhelpers 2.0.0-beta.7 → 2.0.0-beta.9

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.
Files changed (41) hide show
  1. package/dist/lib/helpers/ApiHelpers.js.map +1 -1
  2. package/dist/lib/helpers/ConstantHelper.js.map +1 -1
  3. package/dist/lib/helpers/DataTypeApiHelper.d.ts +2 -2
  4. package/dist/lib/helpers/DataTypeApiHelper.js +3 -3
  5. package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
  6. package/dist/lib/helpers/DictionaryApiHelper.d.ts +11 -8
  7. package/dist/lib/helpers/DictionaryApiHelper.js +90 -65
  8. package/dist/lib/helpers/DictionaryApiHelper.js.map +1 -1
  9. package/dist/lib/helpers/DictionaryUiHelper.d.ts +34 -0
  10. package/dist/lib/helpers/DictionaryUiHelper.js +101 -0
  11. package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -0
  12. package/dist/lib/helpers/DocumentApiHelper.js.map +1 -1
  13. package/dist/lib/helpers/LanguageApiHelper.js.map +1 -1
  14. package/dist/lib/helpers/PackageApiHelper.js.map +1 -1
  15. package/dist/lib/helpers/PartialViewApiHelper.d.ts +10 -7
  16. package/dist/lib/helpers/PartialViewApiHelper.js +97 -77
  17. package/dist/lib/helpers/PartialViewApiHelper.js.map +1 -1
  18. package/dist/lib/helpers/PartialViewUiHelper.d.ts +25 -0
  19. package/dist/lib/helpers/PartialViewUiHelper.js +74 -0
  20. package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -0
  21. package/dist/lib/helpers/ScriptApiHelper.js.map +1 -1
  22. package/dist/lib/helpers/ScriptUiHelper.d.ts +22 -0
  23. package/dist/lib/helpers/ScriptUiHelper.js +68 -0
  24. package/dist/lib/helpers/ScriptUiHelper.js.map +1 -0
  25. package/dist/lib/helpers/StylesheetApiHelper.js.map +1 -1
  26. package/dist/lib/helpers/StylesheetUiHelper.d.ts +11 -19
  27. package/dist/lib/helpers/StylesheetUiHelper.js +31 -47
  28. package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
  29. package/dist/lib/helpers/TemplateApiHelper.js.map +1 -1
  30. package/dist/lib/helpers/TemplateUiHelper.d.ts +29 -0
  31. package/dist/lib/helpers/TemplateUiHelper.js +87 -0
  32. package/dist/lib/helpers/TemplateUiHelper.js.map +1 -0
  33. package/dist/lib/helpers/UiBaseLocators.d.ts +41 -0
  34. package/dist/lib/helpers/UiBaseLocators.js +117 -0
  35. package/dist/lib/helpers/UiBaseLocators.js.map +1 -0
  36. package/dist/lib/helpers/UiHelpers.d.ts +11 -4
  37. package/dist/lib/helpers/UiHelpers.js +20 -23
  38. package/dist/lib/helpers/UiHelpers.js.map +1 -1
  39. package/dist/lib/helpers/testExtension.js.map +1 -1
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ApiHelpers.js","sourceRoot":"","sources":["../../../lib/helpers/ApiHelpers.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AACnD,iDAA4C;AAC5C,qEAAgE;AAChE,2DAAuD;AACvD,+DAA0D;AAC1D,iDAAqD;AACrD,6DAAwD;AACxD,2DAAsD;AACtD,+CAA0C;AAC1C,2DAAsD;AACtD,mDAA8C;AAC9C,qEAAgE;AAChE,2DAAsD;AACtD,yDAAoD;AACpD,uDAAkD;AAClD,iEAA4D;AAC5D,+DAA0D;AAC1D,yBAAyB;AACzB,6DAAwD;AAExD,MAAa,UAAU;IACnB,OAAO,GAAW,8BAAa,CAAC,WAAW,CAAC,OAAO,CAAC;IACpD,IAAI,CAAO;IACX,KAAK,CAAc;IACnB,MAAM,CAAe;IACrB,SAAS,CAAyB;IAClC,QAAQ,CAAqB;IAC7B,UAAU,CAAsB;IAChC,YAAY,CAAwB;IACpC,SAAS,CAAqB;IAC9B,QAAQ,CAAoB;IAC5B,QAAQ,CAAoB;IAC5B,IAAI,CAAgB;IACpB,aAAa,CAAyB;I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AS,EAAE;gBACP,EAAE,EAAE,EAAE;gBACN,IAAI,EAAE;oBACF,IAAI,EAAE,IAAI;oBACV,QAAQ,EAAE,QAAQ;oBAClB,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;iBACpC;aACJ;YACD,iBAAiB,EAAE,IAAI;SAC1B,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACJ;AA1HD,gCA0HC","sourcesContent":["import {Page} from \"@playwright/test\"\nimport {umbracoConfig} from \"../../umbraco.config\";\nimport {ReportHelper} from \"./ReportHelper\";\nimport {TelemetryDataApiHelper} from \"./TelemetryDataApiHelper\";\nimport {LanguagesApiHelper} from \"./LanguageApiHelper\";\nimport {DictionaryApiHelper} from \"./DictionaryApiHelper\";\nimport {RelationTypeApiHelper} from \"./RelationType\";\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 {DocumentApiHelper} from \"./DocumentApiHelper\";\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\";\n\nexport class ApiHelpers {\n baseUrl: string = umbracoConfig.environment.baseUrl;\n page: Page;\n alias: AliasHelper;\n report: ReportHelper;\n telemetry: TelemetryDataApiHelper;\n language: LanguagesApiHelper;\n dictionary: DictionaryApiHelper;\n relationType: RelationTypeApiHelper;\n userGroup: UserGroupApiHelper;\n template: TemplateApiHelper;\n dataType: DataTypeApiHelper;\n user: UserApiHelper;\n temporaryFile: TemporaryFileApiHelper;\n document: DocumentApiHelper;\n package: PackageApiHelper;\n script: ScriptApiHelper;\n partialView: PartialViewApiHelper;\n stylesheet: StylesheetApiHelper;\n logViewer: LogViewerApiHelper;\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 LanguagesApiHelper(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.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 }\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}"]}
1
+ {"version":3,"file":"ApiHelpers.js","sourceRoot":"","sources":["../../../lib/helpers/ApiHelpers.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AACnD,iDAA4C;AAC5C,qEAAgE;AAChE,2DAAuD;AACvD,+DAA0D;AAC1D,iDAAqD;AACrD,6DAAwD;AACxD,2DAAsD;AACtD,+CAA0C;AAC1C,2DAAsD;AACtD,mDAA8C;AAC9C,qEAAgE;AAChE,2DAAsD;AACtD,yDAAoD;AACpD,uDAAkD;AAClD,iEAA4D;AAC5D,+DAA0D;AAC1D,yBAAyB;AACzB,6DAAwD;AAExD,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,CAAqB;IAC7B,UAAU,CAAsB;IAChC,YAAY,CAAwB;IACpC,SAAS,CAAqB;IAC9B,QAAQ,CAAoB;IAC5B,QAAQ,CAAoB;IAC5B,IAAI,CAAgB;IACpB,aAAa,CAAyB;IACtC,QAAQ,CAAoB;IAC5B,OAAO,CAAmB;IAC1B,MAAM,CAAkB;IACxB,WAAW,CAAuB;IAClC,UAAU,CAAsB;IAChC,SA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AE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;iBAClC;aACF;YACD,iBAAiB,EAAE,IAAI;SACxB,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF;AA1HD,gCA0HC","sourcesContent":["import {Page} from \"@playwright/test\"\nimport {umbracoConfig} from \"../../umbraco.config\";\nimport {ReportHelper} from \"./ReportHelper\";\nimport {TelemetryDataApiHelper} from \"./TelemetryDataApiHelper\";\nimport {LanguagesApiHelper} from \"./LanguageApiHelper\";\nimport {DictionaryApiHelper} from \"./DictionaryApiHelper\";\nimport {RelationTypeApiHelper} from \"./RelationType\";\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 {DocumentApiHelper} from \"./DocumentApiHelper\";\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\";\n\nexport class ApiHelpers {\n baseUrl: string = umbracoConfig.environment.baseUrl;\n page: Page;\n alias: AliasHelper;\n report: ReportHelper;\n telemetry: TelemetryDataApiHelper;\n language: LanguagesApiHelper;\n dictionary: DictionaryApiHelper;\n relationType: RelationTypeApiHelper;\n userGroup: UserGroupApiHelper;\n template: TemplateApiHelper;\n dataType: DataTypeApiHelper;\n user: UserApiHelper;\n temporaryFile: TemporaryFileApiHelper;\n document: DocumentApiHelper;\n package: PackageApiHelper;\n script: ScriptApiHelper;\n partialView: PartialViewApiHelper;\n stylesheet: StylesheetApiHelper;\n logViewer: LogViewerApiHelper;\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 LanguagesApiHelper(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.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 }\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}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAEhB,MAAM,CAAU,QAAQ,GAAG;QAC9B,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,OAAO;KACjB,CAAA;;AAVL,wCAWC","sourcesContent":["export class ConstantHelper {\n\n public static readonly sections = {\n content: \"Content\",\n media: \"Media\",\n settings: \"Settings\",\n packages: \"Packages\",\n members: \"Members\",\n dictionary: \"Dictionary\",\n users: \"Users\"\n }\n}"]}
1
+ {"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAElB,MAAM,CAAU,QAAQ,GAAG;QAChC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,OAAO;KACf,CAAA;;AAVH,wCAWC","sourcesContent":["export class ConstantHelper {\n\n public static readonly sections = {\n content: \"Content\",\n media: \"Media\",\n settings: \"Settings\",\n packages: \"Packages\",\n members: \"Members\",\n dictionary: \"Dictionary\",\n users: \"Users\"\n }\n}"]}
@@ -5,10 +5,10 @@ export declare class DataTypeApiHelper {
5
5
  ensureNameNotExistsAtRoot(name: string): Promise<void | import("playwright-core").APIResponse | null>;
6
6
  get(id: string): Promise<any>;
7
7
  getByNameAtRoot(name: string): Promise<any>;
8
- create(name: string, propertyEditorAlias: string, values: {
8
+ create(name: string, editorAlias: string, values: {
9
9
  alias: string;
10
10
  value: string;
11
- }[], parentId?: string, propertyEditorUiAlias?: string): Promise<string | undefined>;
11
+ }[], parentId?: string, editorUiAlias?: string): Promise<string | undefined>;
12
12
  update(id: string, dataType: any): Promise<import("playwright-core").APIResponse>;
13
13
  delete(id: string): Promise<import("playwright-core").APIResponse>;
14
14
  deleteByNameAtRoot(name: string): Promise<import("playwright-core").APIResponse | null>;
@@ -47,11 +47,11 @@ class DataTypeApiHelper {
47
47
  }
48
48
  return null;
49
49
  }
50
- async create(name, propertyEditorAlias, values, parentId, propertyEditorUiAlias) {
50
+ async create(name, editorAlias, values, parentId, editorUiAlias) {
51
51
  const dataType = {
52
52
  "name": name,
53
- "propertyEditorAlias": propertyEditorAlias,
54
- "propertyEditorUiAlias": propertyEditorUiAlias,
53
+ "editorAlias": editorAlias,
54
+ "editorUiAlias": editorUiAlias,
55
55
  "values": values,
56
56
  "parentId": parentId
57
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DataTypeApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DataTypeApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAC5B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,IAAY;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,oFAAoF,CAAC,CAAC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AC9C;yBAAM;wBACL,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,8CAA8C,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;qBACrG;iBACF;qBAAM;oBACL,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,uCAAuC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;iBAC9F;aACF;SACF;QACD,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,8CAA8C,GAAG,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AA3OD,8CA2OC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DataTypeApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async ensureNameNotExistsAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.isFolder == false) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n } else {\n if (sb.hasChildren == true) {\n return await this.recurseFolderChildren(sb.id);\n } else {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n }\n }\n }\n }\n return null;\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getByNameAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n return response.json();\n }\n }\n }\n return null;\n }\n\n async create(name: string, propertyEditorAlias: string, values: {alias: string;value: string; }[], parentId?: string, propertyEditorUiAlias?: string) {\n const dataType = {\n \"name\": name,\n \"propertyEditorAlias\": propertyEditorAlias,\n \"propertyEditorUiAlias\": propertyEditorUiAlias,\n \"values\": values,\n \"parentId\": parentId\n };\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type', dataType);\n // Returns the id of the created dataType\n return response.headers().location.split(\"/\").pop();\n }\n\n async update(id: string, dataType) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id, dataType);\n }\n\n async delete(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n }\n\n async deleteByNameAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n }\n }\n }\n return null;\n }\n\n async getItems(ids: string[]) {\n let idArray = 'id=' + ids[0];\n let i: number;\n\n for (i = 1; i < ids.length; ++i) {\n idArray += '&id=' + ids[i];\n }\n\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/item?' + idArray);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getAllAtRoot() {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async exists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n return response.status() === 200;\n }\n\n async nameExistsAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n return true;\n }\n }\n return false;\n }\n\n async moveToFolder(dataTypeId: string, folderId: string) {\n const folderIdBody = {\n \"targetId\": folderId\n };\n return await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + dataTypeId + '/move', folderIdBody);\n }\n\n async copyToFolder(dataTypeId: string, folderId: string) {\n const folderIdBody = {\n \"targetId\": folderId\n };\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + dataTypeId + '/copy', folderIdBody);\n // Returns the id of the copied dataType\n return response.headers().location.split(\"/\").pop();\n }\n\n // FOLDER\n async getFolder(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n return await response.json();\n }\n\n async folderExists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n return response.status() === 200;\n }\n\n async getFolderByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=true');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n return response.json();\n }\n }\n }\n return null;\n }\n\n async createFolder(name: string, parentId?: string) {\n const folderData = {\n \"name\": name,\n \"parentId\": parentId\n };\n\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder', folderData);\n // Returns the id of the created dataTypeFolder\n return response.headers().location.split(\"/\").pop();\n }\n\n async updateFolder(id: string, dataTypeFolder) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id, dataTypeFolder);\n }\n\n async deleteFolder(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n }\n\n async deleteFolderByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=true');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n }\n }\n }\n return null;\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/children?parentId=' + id + '&skip=0&take=100&foldersOnly=false');\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async recurseFolderChildren(id: string) {\n const parentDataType = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/children?parentId=' + id + '&skip=0&take=10000');\n const itemsJson = await parentDataType.json();\n\n for (const child of itemsJson.items) {\n if (child.path !== null) {\n if (child.isFolder == true) {\n if (child.hasChildren == true) {\n await this.recurseFolderChildren(child.path);\n } else {\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + child.id);\n }\n } else {\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + child.id);\n }\n }\n }\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n }\n}"]}
1
+ {"version":3,"file":"DataTypeApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DataTypeApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAC5B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,IAAY;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,oFAAoF,CAAC,CAAC;QAC7I,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC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AG,CAAC,OAAO,GAAG,8CAA8C,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;qBACrG;iBACF;qBAAM;oBACL,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,uCAAuC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;iBAC9F;aACF;SACF;QACD,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,8CAA8C,GAAG,EAAE,CAAC,CAAC;IAChG,CAAC;CACF;AA3OD,8CA2OC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DataTypeApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async ensureNameNotExistsAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.isFolder == false) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n } else {\n if (sb.hasChildren == true) {\n return await this.recurseFolderChildren(sb.id);\n } else {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n }\n }\n }\n }\n return null;\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getByNameAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n return response.json();\n }\n }\n }\n return null;\n }\n\n async create(name: string, editorAlias: string, values: { alias: string; value: string; }[], parentId?: string, editorUiAlias?: string) {\n const dataType = {\n \"name\": name,\n \"editorAlias\": editorAlias,\n \"editorUiAlias\": editorUiAlias,\n \"values\": values,\n \"parentId\": parentId\n };\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type', dataType);\n // Returns the id of the created dataType\n return response.headers().location.split(\"/\").pop();\n }\n\n async update(id: string, dataType) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id, dataType);\n }\n\n async delete(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n }\n\n async deleteByNameAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + sb.id);\n }\n }\n }\n return null;\n }\n\n async getItems(ids: string[]) {\n let idArray = 'id=' + ids[0];\n let i: number;\n\n for (i = 1; i < ids.length; ++i) {\n idArray += '&id=' + ids[i];\n }\n\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/item?' + idArray);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getAllAtRoot() {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async exists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + id);\n return response.status() === 200;\n }\n\n async nameExistsAtRoot(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=false');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n return true;\n }\n }\n return false;\n }\n\n async moveToFolder(dataTypeId: string, folderId: string) {\n const folderIdBody = {\n \"targetId\": folderId\n };\n return await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + dataTypeId + '/move', folderIdBody);\n }\n\n async copyToFolder(dataTypeId: string, folderId: string) {\n const folderIdBody = {\n \"targetId\": folderId\n };\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + dataTypeId + '/copy', folderIdBody);\n // Returns the id of the copied dataType\n return response.headers().location.split(\"/\").pop();\n }\n\n // FOLDER\n async getFolder(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n return await response.json();\n }\n\n async folderExists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n return response.status() === 200;\n }\n\n async getFolderByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=true');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n return response.json();\n }\n }\n }\n return null;\n }\n\n async createFolder(name: string, parentId?: string) {\n const folderData = {\n \"name\": name,\n \"parentId\": parentId\n };\n\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder', folderData);\n // Returns the id of the created dataTypeFolder\n return response.headers().location.split(\"/\").pop();\n }\n\n async updateFolder(id: string, dataTypeFolder) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id, dataTypeFolder);\n }\n\n async deleteFolder(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n }\n\n async deleteFolderByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/root?skip=0&take=10000&foldersOnly=true');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + sb.id);\n }\n }\n }\n return null;\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/children?parentId=' + id + '&skip=0&take=100&foldersOnly=false');\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async recurseFolderChildren(id: string) {\n const parentDataType = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/data-type/children?parentId=' + id + '&skip=0&take=10000');\n const itemsJson = await parentDataType.json();\n\n for (const child of itemsJson.items) {\n if (child.path !== null) {\n if (child.isFolder == true) {\n if (child.hasChildren == true) {\n await this.recurseFolderChildren(child.path);\n } else {\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + child.id);\n }\n } else {\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/' + child.id);\n }\n }\n }\n await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/data-type/folder/' + id);\n }\n}"]}
@@ -2,19 +2,22 @@ import { ApiHelpers } from "./ApiHelpers";
2
2
  export declare class DictionaryApiHelper {
3
3
  api: ApiHelpers;
4
4
  constructor(api: ApiHelpers);
5
- ensureNameNotExists(name: string): Promise<import("playwright-core").APIResponse | null>;
6
5
  get(id: string): Promise<any>;
7
- getByName(name: string): Promise<any>;
6
+ exists(id: string): Promise<boolean>;
8
7
  create(name: string, translations?: {
9
8
  isoCode: string;
10
9
  translation: string;
11
10
  }[], parentId?: string): Promise<string | undefined>;
12
- delete(id: string): Promise<import("playwright-core").APIResponse>;
13
- deleteByName(name: string): Promise<import("playwright-core").APIResponse | null>;
14
11
  update(id: string, dictionary: object): Promise<import("playwright-core").APIResponse>;
15
- nameExists(name: string): Promise<boolean>;
16
- exists(id: string): Promise<boolean>;
17
- getChildren(id: string): Promise<any>;
18
- getItems(ids: string[]): Promise<any>;
12
+ delete(id: string): Promise<import("playwright-core").APIResponse>;
19
13
  getAllAtRoot(): Promise<import("playwright-core").APIResponse>;
14
+ getItems(ids: string[]): Promise<any>;
15
+ getChildren(id: string): Promise<any>;
16
+ private recurseDeleteChildren;
17
+ private recurseChildren;
18
+ getByName(name: string): Promise<any>;
19
+ doesNameExist(name: string): Promise<any>;
20
+ ensureNameNotExists(name: string): Promise<void>;
21
+ export(id: string, includeChildren: boolean): Promise<import("playwright-core").APIResponse>;
22
+ import(temporaryFileId: string, parentId: string): Promise<import("playwright-core").APIResponse>;
20
23
  }
@@ -6,38 +6,13 @@ class DictionaryApiHelper {
6
6
  constructor(api) {
7
7
  this.api = api;
8
8
  }
9
- async ensureNameNotExists(name) {
10
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=10000');
11
- const json = await response.json();
12
- for (const sb of json.items) {
13
- if (sb.name === name) {
14
- if (sb.id !== null) {
15
- return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);
16
- }
17
- }
18
- }
19
- return null;
20
- }
21
9
  async get(id) {
22
10
  const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);
23
- const json = await response.json();
24
- if (json !== null) {
25
- return json;
26
- }
27
- return null;
11
+ return await response.json();
28
12
  }
29
- async getByName(name) {
30
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=10000');
31
- const json = await response.json();
32
- for (const sb of json.items) {
33
- if (sb.name === name) {
34
- if (sb.id !== null) {
35
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);
36
- return await response.json();
37
- }
38
- }
39
- }
40
- return null;
13
+ async exists(id) {
14
+ const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);
15
+ return response.status() === 200;
41
16
  }
42
17
  async create(name, translations, parentId) {
43
18
  const dictionary = {
@@ -49,44 +24,14 @@ class DictionaryApiHelper {
49
24
  // Returns the id of the created dictionary
50
25
  return response.headers().location.split("/").pop();
51
26
  }
52
- async delete(id) {
53
- return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);
54
- }
55
- async deleteByName(name) {
56
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=100000');
57
- const json = await response.json();
58
- for (const sb of json.items) {
59
- if (sb.name === name) {
60
- if (sb.id !== null)
61
- return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);
62
- }
63
- }
64
- return null;
65
- }
66
27
  async update(id, dictionary) {
67
28
  return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id, dictionary);
68
29
  }
69
- async nameExists(name) {
70
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=100000');
71
- const json = await response.json();
72
- for (const sb of json.items) {
73
- if (sb.name === name) {
74
- return true;
75
- }
76
- }
77
- return false;
78
- }
79
- async exists(id) {
80
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);
81
- return response.status() === 200;
30
+ async delete(id) {
31
+ return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);
82
32
  }
83
- async getChildren(id) {
84
- const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/children?parentId=' + id + '&skip=0&take=10000');
85
- const json = response.json();
86
- if (json !== null) {
87
- return json;
88
- }
89
- return null;
33
+ async getAllAtRoot() {
34
+ return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/root?skip=0&take=10000');
90
35
  }
91
36
  async getItems(ids) {
92
37
  let idArray = 'id=' + ids[0];
@@ -101,8 +46,88 @@ class DictionaryApiHelper {
101
46
  }
102
47
  return null;
103
48
  }
104
- async getAllAtRoot() {
105
- return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/root?skip=0&take=10000');
49
+ async getChildren(id) {
50
+ const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/children?parentId=' + id + '&skip=0&take=10000');
51
+ const items = await response.json();
52
+ return items.items;
53
+ }
54
+ async recurseDeleteChildren(id) {
55
+ const items = await this.getChildren(id);
56
+ for (const child of items) {
57
+ if (child.isContainer || child.hasChildren) {
58
+ await this.recurseDeleteChildren(child.id);
59
+ }
60
+ else {
61
+ await this.delete(child.id);
62
+ }
63
+ }
64
+ return await this.delete(id);
65
+ }
66
+ async recurseChildren(name, id, toDelete) {
67
+ const items = await this.getChildren(id);
68
+ for (const child of items) {
69
+ if (child.name === name) {
70
+ if (!toDelete) {
71
+ return await this.get(child.id);
72
+ }
73
+ if (child.isContainer || child.hasChildren) {
74
+ return await this.recurseDeleteChildren(child.id);
75
+ }
76
+ else {
77
+ return await this.delete(child.id);
78
+ }
79
+ }
80
+ else if (child.isContainer || child.hasChildren) {
81
+ await this.recurseChildren(name, child.id, toDelete);
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ async getByName(name) {
87
+ const rootDictionary = await this.getAllAtRoot();
88
+ const jsonDictionary = await rootDictionary.json();
89
+ for (const dictionaryItem of jsonDictionary.items) {
90
+ if (dictionaryItem.name === name) {
91
+ return this.get(dictionaryItem.id);
92
+ }
93
+ else if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {
94
+ const result = await this.recurseChildren(name, dictionaryItem.id, false);
95
+ if (result) {
96
+ return result;
97
+ }
98
+ }
99
+ }
100
+ return false;
101
+ }
102
+ async doesNameExist(name) {
103
+ return await this.getByName(name);
104
+ }
105
+ async ensureNameNotExists(name) {
106
+ const rootDictionary = await this.getAllAtRoot();
107
+ const jsonDictionary = await rootDictionary.json();
108
+ for (const dictionaryItem of jsonDictionary.items) {
109
+ if (dictionaryItem.name === name) {
110
+ if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {
111
+ await this.recurseDeleteChildren(dictionaryItem.id);
112
+ }
113
+ await this.delete(dictionaryItem.id);
114
+ }
115
+ else {
116
+ if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {
117
+ await this.recurseChildren(name, dictionaryItem.id, true);
118
+ }
119
+ }
120
+ }
121
+ }
122
+ async export(id, includeChildren) {
123
+ return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id + '/export?includeChidren=' + includeChildren);
124
+ }
125
+ async import(temporaryFileId, parentId) {
126
+ const importDictionary = {
127
+ "temporaryFileId": temporaryFileId,
128
+ "parentId": parentId
129
+ };
130
+ return await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/import', importDictionary);
106
131
  }
107
132
  }
108
133
  exports.DictionaryApiHelper = DictionaryApiHelper;
@@ -1 +1 @@
1
- {"version":3,"file":"DictionaryApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DictionaryApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAC9B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAAY;QACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,yDAAyD,CAAC,CAAC;QAClH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE;YAC3B,IAAI,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE;gBACpB,IAAI,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE;oBAClB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,wCAAwC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;iBACnG;aACF;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,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CAAC;QACrH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,OAAO,IAAI,CAAC;SACb;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,mEAAmE,CAAC,CAAC;IACpH,CAAC;CACF;AA5HD,kDA4HC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DictionaryApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async ensureNameNotExists(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=10000');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);\n }\n }\n }\n return null;\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=10000');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);\n return await response.json();\n }\n }\n }\n return null;\n }\n\n async create(name: string, translations?: { isoCode: string, translation: string }[], parentId?: string) {\n const dictionary = {\n \"name\": name,\n \"translations\": translations,\n \"parentId\": parentId\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/dictionary', dictionary);\n // Returns the id of the created dictionary\n return response.headers().location.split(\"/\").pop();\n }\n\n async delete(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);\n }\n\n async deleteByName(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=100000');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n if (sb.id !== null)\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + sb.id);\n }\n }\n return null;\n }\n\n async update(id: string, dictionary: object) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id, dictionary);\n }\n\n async nameExists(name: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary?skip=0&take=100000');\n const json = await response.json();\n\n for (const sb of json.items) {\n if (sb.name === name) {\n return true;\n }\n }\n return false;\n }\n\n async exists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);\n return response.status() === 200;\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/children?parentId=' + id + '&skip=0&take=10000');\n const json = response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getItems(ids: string[]) {\n let idArray = 'id=' + ids[0];\n let i: number;\n\n for (i = 1; i < ids.length; ++i) {\n idArray += '&id=' + ids[i];\n }\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/item?' + idArray);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getAllAtRoot() {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/root?skip=0&take=10000');\n }\n}"]}
1
+ {"version":3,"file":"DictionaryApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DictionaryApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAC9B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED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AU,EAAE,eAAwB;QAC/C,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,wCAAwC,GAAG,EAAE,GAAG,yBAAyB,GAAG,eAAe,CAAC,CAAC;IAC5I,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,eAAuB,EAAE,QAAgB;QACpD,MAAM,gBAAgB,GAAG;YACvB,iBAAiB,EAAE,eAAe;YAClC,UAAU,EAAE,QAAQ;SACrB,CAAA;QACD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,8CAA8C,EAAE,gBAAgB,CAAC,CAAC;IAClH,CAAC;CACF;AAjJD,kDAiJC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DictionaryApiHelper {\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/dictionary/' + id);\n return await response.json();\n }\n\n async exists(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);\n return response.status() === 200;\n }\n\n async create(name: string, translations?: { isoCode: string, translation: string }[], parentId?: string) {\n const dictionary = {\n \"name\": name,\n \"translations\": translations,\n \"parentId\": parentId\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/dictionary', dictionary);\n // Returns the id of the created dictionary\n return response.headers().location.split(\"/\").pop();\n }\n\n async update(id: string, dictionary: object) {\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id, dictionary);\n }\n\n async delete(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id);\n }\n\n async getAllAtRoot() {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/root?skip=0&take=10000');\n }\n\n async getItems(ids: string[]) {\n let idArray = 'id=' + ids[0];\n let i: number;\n\n for (i = 1; i < ids.length; ++i) {\n idArray += '&id=' + ids[i];\n }\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/item?' + idArray);\n const json = await response.json();\n\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/dictionary/children?parentId=' + id + '&skip=0&take=10000');\n const items = await response.json();\n return items.items;\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.isContainer || 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.isContainer || child.hasChildren) {\n return await this.recurseDeleteChildren(child.id);\n } else {\n return await this.delete(child.id);\n }\n } else if (child.isContainer || child.hasChildren) {\n await this.recurseChildren(name, child.id, toDelete);\n }\n }\n return false;\n }\n\n async getByName(name: string) {\n const rootDictionary = await this.getAllAtRoot();\n const jsonDictionary = await rootDictionary.json();\n\n for (const dictionaryItem of jsonDictionary.items) {\n if (dictionaryItem.name === name) {\n return this.get(dictionaryItem.id);\n } else if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {\n const result = await this.recurseChildren(name, dictionaryItem.id, false);\n if (result) {\n return result;\n }\n }\n }\n return false;\n }\n\n async doesNameExist(name: string) {\n return await this.getByName(name);\n }\n\n async ensureNameNotExists(name: string) {\n const rootDictionary = await this.getAllAtRoot();\n const jsonDictionary = await rootDictionary.json();\n\n for (const dictionaryItem of jsonDictionary.items) {\n if (dictionaryItem.name === name) {\n if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {\n await this.recurseDeleteChildren(dictionaryItem.id);\n }\n await this.delete(dictionaryItem.id);\n } else {\n if (dictionaryItem.isContainer || dictionaryItem.hasChildren) {\n await this.recurseChildren(name, dictionaryItem.id, true);\n }\n }\n }\n }\n\n async export(id: string, includeChildren: boolean) {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/' + id + '/export?includeChidren=' + includeChildren);\n }\n\n async import(temporaryFileId: string, parentId: string) {\n const importDictionary = {\n \"temporaryFileId\": temporaryFileId,\n \"parentId\": parentId\n }\n return await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/dictionary/import', importDictionary);\n }\n}"]}
@@ -0,0 +1,34 @@
1
+ import { Page } from "@playwright/test";
2
+ export declare class DictionaryUiHelper {
3
+ private readonly page;
4
+ private readonly uiBaseLocators;
5
+ private readonly createDictionaryItemBtn;
6
+ private readonly dictionaryNameTxt;
7
+ private readonly createMenu;
8
+ private readonly exportMenu;
9
+ private readonly importMenu;
10
+ private readonly deleteMenu;
11
+ private readonly searchTxt;
12
+ private readonly exportBtn;
13
+ private readonly includeDescendantsCheckbox;
14
+ private readonly importBtn;
15
+ private readonly importFileTxt;
16
+ private readonly emptySearchResultMessage;
17
+ private readonly dictionaryListRows;
18
+ constructor(page: Page);
19
+ clickCreateDictionaryItemButton(): Promise<void>;
20
+ enterDictionaryName(name: string): Promise<void>;
21
+ clickSaveButton(): Promise<void>;
22
+ openActionsMenuForName(name: string): Promise<void>;
23
+ clickCaretButtonForName(name: string): Promise<void>;
24
+ enterSearchKeywordAndPressEnter(keyword: string): Promise<void>;
25
+ clickCreateMenu(): Promise<void>;
26
+ clickExportMenu(): Promise<void>;
27
+ clickImportMenu(): Promise<void>;
28
+ clickDeleteMenu(): Promise<void>;
29
+ deleteDictionary(): Promise<void>;
30
+ doesDictionaryListHaveText(text: string): Promise<boolean>;
31
+ exportDictionary(includesDescendants: boolean): Promise<void>;
32
+ importDictionary(filePath: string): Promise<void>;
33
+ isSearchResultMessageDisplayEmpty(message: string): Promise<void>;
34
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DictionaryUiHelper = void 0;
4
+ const test_1 = require("@playwright/test");
5
+ const UiBaseLocators_1 = require("./UiBaseLocators");
6
+ class DictionaryUiHelper {
7
+ page;
8
+ uiBaseLocators;
9
+ createDictionaryItemBtn;
10
+ dictionaryNameTxt;
11
+ createMenu;
12
+ exportMenu;
13
+ importMenu;
14
+ deleteMenu;
15
+ searchTxt;
16
+ exportBtn;
17
+ includeDescendantsCheckbox;
18
+ importBtn;
19
+ importFileTxt;
20
+ emptySearchResultMessage;
21
+ dictionaryListRows;
22
+ constructor(page) {
23
+ this.page = page;
24
+ this.uiBaseLocators = new UiBaseLocators_1.UiBaseLocators(this.page);
25
+ this.createDictionaryItemBtn = page.getByLabel("Create dictionary item", { exact: true, });
26
+ this.dictionaryNameTxt = page.getByLabel("Dictionary Name", { exact: true, });
27
+ this.createMenu = page.locator("umb-entity-action").getByLabel("Create");
28
+ this.exportMenu = page.locator("umb-entity-action").getByLabel("Export");
29
+ this.importMenu = page.locator("umb-entity-action").getByLabel("Import");
30
+ this.deleteMenu = page.locator("umb-entity-action").getByLabel("Delete");
31
+ this.searchTxt = page.getByLabel("Type to filter...");
32
+ this.dictionaryListRows = page.locator("umb-dashboard-translation-dictionary uui-table-row");
33
+ this.exportBtn = page.locator("umb-export-dictionary-modal").getByLabel("Export");
34
+ this.includeDescendantsCheckbox = page.locator("umb-export-dictionary-modal #includeDescendants");
35
+ this.importBtn = page.locator("umb-export-dictionary-modal").getByLabel("Import");
36
+ this.importFileTxt = page.locator("umb-import-dictionary-modal #input");
37
+ this.emptySearchResultMessage = page.locator("umb-dashboard-translation-dictionary umb-empty-state");
38
+ }
39
+ async clickCreateDictionaryItemButton() {
40
+ await this.createDictionaryItemBtn.click();
41
+ }
42
+ async enterDictionaryName(name) {
43
+ await this.dictionaryNameTxt.clear();
44
+ await this.dictionaryNameTxt.fill(name);
45
+ }
46
+ async clickSaveButton() {
47
+ await this.uiBaseLocators.clickSaveButton();
48
+ }
49
+ async openActionsMenuForName(name) {
50
+ await this.page.locator("umb-tree-item").locator('[label="' + name + '"] >> [label="Open actions menu"]').click();
51
+ }
52
+ async clickCaretButtonForName(name) {
53
+ await this.page.locator('umb-tree-item >> [label="' + name + '"]').locator("#caret-button").click();
54
+ }
55
+ async enterSearchKeywordAndPressEnter(keyword) {
56
+ await this.searchTxt.clear();
57
+ await this.searchTxt.fill(keyword);
58
+ await this.page.keyboard.press("Enter");
59
+ }
60
+ async clickCreateMenu() {
61
+ await this.createMenu.click();
62
+ }
63
+ async clickExportMenu() {
64
+ await this.exportMenu.click();
65
+ }
66
+ async clickImportMenu() {
67
+ await this.importMenu.click();
68
+ }
69
+ async clickDeleteMenu() {
70
+ await this.deleteMenu.click();
71
+ }
72
+ async deleteDictionary() {
73
+ await this.clickDeleteMenu();
74
+ await this.uiBaseLocators.confirmToDeleteBtn.click();
75
+ }
76
+ async doesDictionaryListHaveText(text) {
77
+ const allRows = await this.dictionaryListRows.all();
78
+ for (let currentRow of allRows) {
79
+ const currentText = await currentRow.innerText();
80
+ if (currentText.includes(text)) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ async exportDictionary(includesDescendants) {
87
+ if (includesDescendants) {
88
+ await this.includeDescendantsCheckbox.click();
89
+ }
90
+ await this.exportBtn.click();
91
+ }
92
+ async importDictionary(filePath) {
93
+ await this.importFileTxt.setInputFiles(filePath);
94
+ await this.importBtn.click();
95
+ }
96
+ async isSearchResultMessageDisplayEmpty(message) {
97
+ return await (0, test_1.expect)(this.emptySearchResultMessage).toHaveText(message);
98
+ }
99
+ }
100
+ exports.DictionaryUiHelper = DictionaryUiHelper;
101
+ //# sourceMappingURL=DictionaryUiHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DictionaryUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DictionaryUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAEhD,MAAa,kBAA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EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,QAAgB;QACrC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,iCAAiC,CAAC,OAAe;QACrD,OAAO,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzE,CAAC;CACF;AA7GD,gDA6GC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class DictionaryUiHelper {\n private readonly page: Page;\n private readonly uiBaseLocators: UiBaseLocators;\n private readonly createDictionaryItemBtn: Locator;\n private readonly dictionaryNameTxt: Locator;\n private readonly createMenu: Locator;\n private readonly exportMenu: Locator;\n private readonly importMenu: Locator;\n private readonly deleteMenu: Locator;\n private readonly searchTxt: Locator;\n private readonly exportBtn: Locator;\n private readonly includeDescendantsCheckbox: Locator;\n private readonly importBtn: Locator;\n private readonly importFileTxt: Locator;\n private readonly emptySearchResultMessage: Locator;\n private readonly dictionaryListRows: Locator;\n\n constructor(page: Page) {\n this.page = page;\n this.uiBaseLocators = new UiBaseLocators(this.page);\n this.createDictionaryItemBtn = page.getByLabel(\"Create dictionary item\", {exact: true,});\n this.dictionaryNameTxt = page.getByLabel(\"Dictionary Name\", {exact: true,});\n this.createMenu = page.locator(\"umb-entity-action\").getByLabel(\"Create\");\n this.exportMenu = page.locator(\"umb-entity-action\").getByLabel(\"Export\");\n this.importMenu = page.locator(\"umb-entity-action\").getByLabel(\"Import\");\n this.deleteMenu = page.locator(\"umb-entity-action\").getByLabel(\"Delete\");\n this.searchTxt = page.getByLabel(\"Type to filter...\");\n this.dictionaryListRows = page.locator(\"umb-dashboard-translation-dictionary uui-table-row\");\n this.exportBtn = page.locator(\"umb-export-dictionary-modal\").getByLabel(\"Export\");\n this.includeDescendantsCheckbox = page.locator(\"umb-export-dictionary-modal #includeDescendants\");\n this.importBtn = page.locator(\"umb-export-dictionary-modal\").getByLabel(\"Import\");\n this.importFileTxt = page.locator(\"umb-import-dictionary-modal #input\");\n this.emptySearchResultMessage = page.locator(\"umb-dashboard-translation-dictionary umb-empty-state\");\n }\n\n async clickCreateDictionaryItemButton() {\n await this.createDictionaryItemBtn.click();\n }\n\n async enterDictionaryName(name: string) {\n await this.dictionaryNameTxt.clear();\n await this.dictionaryNameTxt.fill(name);\n }\n\n async clickSaveButton() {\n await this.uiBaseLocators.clickSaveButton();\n }\n\n async openActionsMenuForName(name: string) {\n await this.page.locator(\"umb-tree-item\").locator('[label=\"' + name + '\"] >> [label=\"Open actions menu\"]').click();\n }\n\n async clickCaretButtonForName(name: string) {\n await this.page.locator('umb-tree-item >> [label=\"' + name + '\"]').locator(\"#caret-button\").click();\n }\n\n async enterSearchKeywordAndPressEnter(keyword: string) {\n await this.searchTxt.clear();\n await this.searchTxt.fill(keyword);\n await this.page.keyboard.press(\"Enter\");\n }\n\n async clickCreateMenu() {\n await this.createMenu.click();\n }\n\n async clickExportMenu() {\n await this.exportMenu.click();\n }\n\n async clickImportMenu() {\n await this.importMenu.click();\n }\n\n async clickDeleteMenu() {\n await this.deleteMenu.click();\n }\n\n async deleteDictionary() {\n await this.clickDeleteMenu();\n await this.uiBaseLocators.confirmToDeleteBtn.click();\n }\n\n async doesDictionaryListHaveText(text: string) {\n const allRows = await this.dictionaryListRows.all();\n for (let currentRow of allRows) {\n const currentText = await currentRow.innerText();\n if (currentText.includes(text)) {\n return true;\n }\n }\n return false;\n }\n\n async exportDictionary(includesDescendants: boolean) {\n if (includesDescendants) {\n await this.includeDescendantsCheckbox.click();\n }\n await this.exportBtn.click();\n }\n\n async importDictionary(filePath: string) {\n await this.importFileTxt.setInputFiles(filePath);\n await this.importBtn.click();\n }\n\n async isSearchResultMessageDisplayEmpty(message: string) {\n return await expect(this.emptySearchResultMessage).toHaveText(message);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAC5B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CAEF;AAPD,8CAOC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DocumentApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n \n}"]}
1
+ {"version":3,"file":"DocumentApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentApiHelper.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAC5B,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CAEF;AAPD,8CAOC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\n\nexport class DocumentApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n}"]}