@salesforcedevs/sfdocs-e2e 1.0.5-alpha → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/sfdocs-e2e",
3
- "version": "1.0.5-alpha",
3
+ "version": "1.0.5",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -1,94 +0,0 @@
1
- import GuidePage from '../pageobjects/guide.page';
2
-
3
- let page: GuidePage;
4
- let liquidEnabled = false;
5
-
6
- describe('Liquid Template Rendering', () => {
7
- before(async () => {
8
- try {
9
- page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
10
- page.open();
11
- await page.waitPageLoad();
12
-
13
- const content = await $('>>>doc-content-layout');
14
- const html = await content.getHTML();
15
- const text = await content.getText();
16
-
17
- const hasLiquidOutput = text.includes('Hello from data.yaml');
18
-
19
- const hasRawSyntax =
20
- html.includes('{{ data.greeting }}') ||
21
- html.includes('{{ topic }}') ||
22
- (html.includes('{{') && html.includes('{%'));
23
-
24
- if (hasRawSyntax) {
25
- liquidEnabled = false;
26
- } else if (hasLiquidOutput) {
27
- liquidEnabled = true;
28
- } else {
29
- liquidEnabled = false;
30
- }
31
- } catch (e) {
32
- liquidEnabled = false;
33
- }
34
- });
35
-
36
- beforeEach(async () => {
37
- if (liquidEnabled) {
38
- page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
39
- page.open();
40
- await page.waitPageLoad();
41
- }
42
- });
43
-
44
- it('Should render Liquid variables from frontmatter and data.yaml', async function () {
45
- if (!liquidEnabled) {
46
- this.skip();
47
- }
48
-
49
- const content = await $('>>>doc-content-layout');
50
- const text = await content.getText();
51
-
52
- expect(text.includes('GitHub for writers')).toBeTruthy();
53
- expect(text.includes('Hello from data.yaml')).toBeTruthy();
54
-
55
- const html = await content.getHTML();
56
- expect(html.includes('{{ topic }}')).toBeFalsy();
57
- expect(html.includes('{{ data.greeting }}')).toBeFalsy();
58
- });
59
-
60
- it('Should render included templates from shared directory', async function () {
61
- if (!liquidEnabled) {
62
- this.skip();
63
- }
64
-
65
- const content = await $('>>>doc-content-layout');
66
- const html = await content.getHTML();
67
-
68
- expect(html.includes('AccountId') || html.includes('Type:')).toBeTruthy();
69
- expect(html.includes('Properties:')).toBeTruthy();
70
- expect(html.includes('Special Access Rules')).toBeTruthy();
71
- expect(html.includes('{% include')).toBeFalsy();
72
- });
73
-
74
- it('Should render loops over data arrays', async function () {
75
- if (!liquidEnabled) {
76
- this.skip();
77
- }
78
-
79
- const content = await $('>>>doc-content-layout');
80
- const html = await content.getHTML();
81
- const text = await content.getText();
82
-
83
- expect(text.includes('create()')).toBeTruthy();
84
- expect(text.includes('query()')).toBeTruthy();
85
- expect(text.includes('update()')).toBeTruthy();
86
-
87
- const listItems = await content.$$('li');
88
- expect(listItems.length).toBeGreaterThan(5);
89
-
90
- expect(html.includes('{% for')).toBeFalsy();
91
- expect(html.includes('{%- for')).toBeFalsy();
92
- expect(html.includes('{% endfor')).toBeFalsy();
93
- });
94
- });