@salesforcedevs/sfdocs-e2e 1.0.7-liquid-alpha → 1.0.7-liquid-alpha.2

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.7-liquid-alpha",
3
+ "version": "1.0.7-liquid-alpha.2",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -0,0 +1,71 @@
1
+ import GuidePage from '../pageobjects/guide.page';
2
+
3
+ let page: GuidePage;
4
+ let liquidEnabled = false;
5
+
6
+ describe('Liquid Template Rendering — Advanced', () => {
7
+ before(async () => {
8
+ try {
9
+ page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
10
+ await browser.url(page.path);
11
+ await page.waitPageLoad();
12
+
13
+ const content = await $('>>>doc-content-layout');
14
+ const text = await content.getText();
15
+
16
+ liquidEnabled = text.includes('Hello from data.yaml');
17
+ } catch (e) {
18
+ liquidEnabled = false;
19
+ }
20
+ });
21
+
22
+ beforeEach(async () => {
23
+ if (liquidEnabled) {
24
+ page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
25
+ await browser.url(page.path);
26
+ await page.waitPageLoad();
27
+ }
28
+ });
29
+
30
+ it('Should render repository-level variables from content-config.yml', async function () {
31
+ if (!liquidEnabled) {
32
+ this.skip();
33
+ }
34
+
35
+ const content = await $('>>>doc-content-layout');
36
+ const text = await content.getText();
37
+ const html = await content.getHTML();
38
+
39
+ expect(text.includes('Salesforce Platform')).toBeTruthy();
40
+ expect(text.includes('62.0')).toBeTruthy();
41
+ expect(text.includes('sf')).toBeTruthy();
42
+ expect(html.includes('{{ variables.platform')).toBeFalsy();
43
+ });
44
+
45
+ it('Should render future block content when previewFuture is enabled', async function () {
46
+ if (!liquidEnabled) {
47
+ this.skip();
48
+ }
49
+
50
+ const content = await $('>>>doc-content-layout');
51
+ const text = await content.getText();
52
+
53
+ expect(text.includes('Coming Soon')).toBeTruthy();
54
+ });
55
+
56
+ it('Should render the future topic page when previewFuture is enabled', async function () {
57
+ if (!liquidEnabled) {
58
+ this.skip();
59
+ }
60
+
61
+ const futurePage = new GuidePage('/docs/liquid-project/guide/future-topic.html');
62
+ await browser.url(futurePage.path);
63
+ await futurePage.waitPageLoad();
64
+
65
+ const content = await $('>>>doc-content-layout');
66
+ const text = await content.getText();
67
+
68
+ expect(text.includes('Future Feature')).toBeTruthy();
69
+ expect(text.includes('previewFuture')).toBeTruthy();
70
+ });
71
+ });
@@ -7,26 +7,13 @@ describe('Liquid Template Rendering', () => {
7
7
  before(async () => {
8
8
  try {
9
9
  page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
10
- page.open();
10
+ await browser.url(page.path);
11
11
  await page.waitPageLoad();
12
12
 
13
13
  const content = await $('>>>doc-content-layout');
14
14
  const text = await content.getText();
15
- const html = await content.getHTML();
16
-
17
- const hasLiquidOutput = text.includes('Hello from data.yaml');
18
- const hasRawSyntax =
19
- html.includes('{{ data.greeting }}') ||
20
- html.includes('{{ topic }}') ||
21
- (html.includes('{{') && html.includes('{%'));
22
-
23
- if (hasRawSyntax) {
24
- liquidEnabled = false;
25
- } else if (hasLiquidOutput) {
26
- liquidEnabled = true;
27
- } else {
28
- liquidEnabled = false;
29
- }
15
+
16
+ liquidEnabled = text.includes('Hello from data.yaml');
30
17
  } catch (e) {
31
18
  liquidEnabled = false;
32
19
  }
@@ -35,7 +22,7 @@ describe('Liquid Template Rendering', () => {
35
22
  beforeEach(async () => {
36
23
  if (liquidEnabled) {
37
24
  page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
38
- page.open();
25
+ await browser.url(page.path);
39
26
  await page.waitPageLoad();
40
27
  }
41
28
  });
@@ -50,10 +37,6 @@ describe('Liquid Template Rendering', () => {
50
37
 
51
38
  expect(text.includes('GitHub for writers')).toBeTruthy();
52
39
  expect(text.includes('Hello from data.yaml')).toBeTruthy();
53
-
54
- const html = await content.getHTML();
55
- expect(html.includes('{{ topic }}')).toBeFalsy();
56
- expect(html.includes('{{ data.greeting }}')).toBeFalsy();
57
40
  });
58
41
 
59
42
  it('Should render included templates from shared directory', async function () {
@@ -76,19 +59,14 @@ describe('Liquid Template Rendering', () => {
76
59
  }
77
60
 
78
61
  const content = await $('>>>doc-content-layout');
79
- const html = await content.getHTML();
80
62
  const text = await content.getText();
81
63
 
82
- expect(text.includes('create()')).toBeTruthy();
83
- expect(text.includes('query()')).toBeTruthy();
84
- expect(text.includes('update()')).toBeTruthy();
64
+ expect(text.includes('AccountId')).toBeTruthy();
65
+ expect(text.includes('Type:')).toBeTruthy();
66
+ expect(text.includes('Properties:')).toBeTruthy();
85
67
 
86
68
  const listItems = await content.$$('li');
87
69
  expect(listItems.length).toBeGreaterThan(5);
88
-
89
- expect(html.includes('{% for')).toBeFalsy();
90
- expect(html.includes('{%- for')).toBeFalsy();
91
- expect(html.includes('{% endfor')).toBeFalsy();
92
70
  });
93
71
 
94
72
  it('Should not process Liquid syntax inside code blocks', async function () {
@@ -97,15 +75,14 @@ describe('Liquid Template Rendering', () => {
97
75
  }
98
76
 
99
77
  const content = await $('>>>doc-content-layout');
100
- const html = await content.getHTML();
101
- const codeBlock = await content.$('code');
78
+ const codeBlock = await content.$('dx-code-block');
102
79
 
103
80
  expect(await codeBlock.isExisting()).toBeTruthy();
104
81
 
105
- const codeHtml = await codeBlock.getHTML();
106
- expect(codeHtml.includes('{{ data.greeting }}')).toBeTruthy();
107
- expect(codeHtml.includes('{{ topic }}')).toBeTruthy();
108
- expect(codeHtml.includes('{% for item in items %}')).toBeTruthy();
82
+ const codeBlockAttr = await codeBlock.getAttribute('code-block');
83
+ expect(codeBlockAttr.includes('{{ data.greeting }}')).toBeTruthy();
84
+ expect(codeBlockAttr.includes('{{ topic }}')).toBeTruthy();
85
+ expect(codeBlockAttr.includes('{% for item in items %}')).toBeTruthy();
109
86
 
110
87
  const text = await content.getText();
111
88
  expect(text.includes('Visit')).toBeTruthy();
@@ -131,21 +108,6 @@ describe('Liquid Template Rendering', () => {
131
108
  expect(html.includes('{{ id2 }}')).toBeFalsy();
132
109
  });
133
110
 
134
- it('Should render repository-level variables from content-config.yml', async function () {
135
- if (!liquidEnabled) {
136
- this.skip();
137
- }
138
-
139
- const content = await $('>>>doc-content-layout');
140
- const text = await content.getText();
141
- const html = await content.getHTML();
142
-
143
- expect(text.includes('Salesforce Platform')).toBeTruthy();
144
- expect(text.includes('62.0')).toBeTruthy();
145
- expect(text.includes('sf')).toBeTruthy();
146
- expect(html.includes('{{ variables.platform')).toBeFalsy();
147
- });
148
-
149
111
  it('Should render englishonly block content in production', async function () {
150
112
  if (!liquidEnabled) {
151
113
  this.skip();
@@ -160,20 +122,6 @@ describe('Liquid Template Rendering', () => {
160
122
  expect(html.includes('{% endenglishonly')).toBeFalsy();
161
123
  });
162
124
 
163
- it('Should render future block content when previewFuture is enabled', async function () {
164
- if (!liquidEnabled) {
165
- this.skip();
166
- }
167
-
168
- const content = await $('>>>doc-content-layout');
169
- const text = await content.getText();
170
- const html = await content.getHTML();
171
-
172
- expect(text.includes('Coming Soon')).toBeTruthy();
173
- expect(html.includes('{% future')).toBeFalsy();
174
- expect(html.includes('{% endfuture')).toBeFalsy();
175
- });
176
-
177
125
  it('Should render liquid.data string format — single YAML file on root context', async function () {
178
126
  if (!liquidEnabled) {
179
127
  this.skip();
@@ -181,10 +129,8 @@ describe('Liquid Template Rendering', () => {
181
129
 
182
130
  const content = await $('>>>doc-content-layout');
183
131
  const text = await content.getText();
184
- const html = await content.getHTML();
185
132
 
186
133
  expect(text.includes('Hello from data.yaml')).toBeTruthy();
187
- expect(html.includes('{{ data.greeting }}')).toBeFalsy();
188
134
  });
189
135
 
190
136
  it('Should render liquid.data object format — multiple YAML files each under a named key', async function () {
@@ -192,43 +138,26 @@ describe('Liquid Template Rendering', () => {
192
138
  this.skip();
193
139
  }
194
140
 
195
- const dataFormatsPage = new GuidePage('/docs/redirects/guide/orders-api-overview.html');
196
- dataFormatsPage.open();
197
- await dataFormatsPage.waitPageLoad();
141
+ const multiDataPage = new GuidePage('/docs/liquid-project/guide/multi-data.html');
142
+ await browser.url(multiDataPage.path);
143
+ await multiDataPage.waitPageLoad();
198
144
 
199
145
  const content = await $('>>>doc-content-layout');
200
146
  const text = await content.getText();
201
147
  const html = await content.getHTML();
202
148
 
203
149
  expect(text.includes('Sample data file to check the multi-include')).toBeTruthy();
204
- expect(text.includes('Represents a scheduled or completed visit')).toBeTruthy();
205
150
  expect(html.includes('{{ two.summary }}')).toBeFalsy();
206
151
  expect(html.includes('{{ data.one.summary }}')).toBeFalsy();
207
152
  });
208
153
 
209
- it('Should render the future topic page when previewFuture is enabled', async function () {
210
- if (!liquidEnabled) {
211
- this.skip();
212
- }
213
-
214
- const futurePage = new GuidePage('/docs/liquid-project/guide/future-topic.html');
215
- futurePage.open();
216
- await futurePage.waitPageLoad();
217
-
218
- const content = await $('>>>doc-content-layout');
219
- const text = await content.getText();
220
-
221
- expect(text.includes('Future Feature')).toBeTruthy();
222
- expect(text.includes('previewFuture')).toBeTruthy();
223
- });
224
-
225
154
  it('Should render the englishonly topic page', async function () {
226
155
  if (!liquidEnabled) {
227
156
  this.skip();
228
157
  }
229
158
 
230
159
  const englishOnlyPage = new GuidePage('/docs/liquid-project/guide/english-only-topic.html');
231
- englishOnlyPage.open();
160
+ await browser.url(englishOnlyPage.path);
232
161
  await englishOnlyPage.waitPageLoad();
233
162
 
234
163
  const content = await $('>>>doc-content-layout');
@@ -238,7 +167,7 @@ describe('Liquid Template Rendering', () => {
238
167
  expect(text.includes('filters: [englishonly]')).toBeTruthy();
239
168
  });
240
169
 
241
- it('Should not process Liquid when frontmatter has liquid.enabled as false', async function () {
170
+ it('Should not render raw Liquid syntax when Liquid processing is disabled', async function () {
242
171
  if (!liquidEnabled) {
243
172
  this.skip();
244
173
  }
@@ -246,7 +175,7 @@ describe('Liquid Template Rendering', () => {
246
175
  const disabledPage = new GuidePage(
247
176
  '/docs/liquid-project/guide/liquid-learning-resources.html',
248
177
  );
249
- disabledPage.open();
178
+ await browser.url(disabledPage.path);
250
179
  await disabledPage.waitPageLoad();
251
180
 
252
181
  const content = await $('>>>doc-content-layout');
@@ -18,7 +18,8 @@ exports.config = {
18
18
 
19
19
  // Exclude tests that require dynamic server features or pages not in static build
20
20
  exclude: [
21
- // './src/shared/specs/liquid.test.ts',
21
+ // Advanced liquid tests require previewFuture, variables — not in static build
22
+ './src/shared/specs/liquid-advanced.test.ts',
22
23
  // /docs/apis landing page doesn't exist in static builds
23
24
  './src/portal/specs/docs.api.test.ts',
24
25
  // /docs landing page doesn't exist in static builds