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

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.1",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -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();
@@ -167,11 +144,8 @@ describe('Liquid Template Rendering', () => {
167
144
 
168
145
  const content = await $('>>>doc-content-layout');
169
146
  const text = await content.getText();
170
- const html = await content.getHTML();
171
147
 
172
148
  expect(text.includes('Coming Soon')).toBeTruthy();
173
- expect(html.includes('{% future')).toBeFalsy();
174
- expect(html.includes('{% endfuture')).toBeFalsy();
175
149
  });
176
150
 
177
151
  it('Should render liquid.data string format — single YAML file on root context', async function () {
@@ -181,10 +155,8 @@ describe('Liquid Template Rendering', () => {
181
155
 
182
156
  const content = await $('>>>doc-content-layout');
183
157
  const text = await content.getText();
184
- const html = await content.getHTML();
185
158
 
186
159
  expect(text.includes('Hello from data.yaml')).toBeTruthy();
187
- expect(html.includes('{{ data.greeting }}')).toBeFalsy();
188
160
  });
189
161
 
190
162
  it('Should render liquid.data object format — multiple YAML files each under a named key', async function () {
@@ -192,8 +164,8 @@ describe('Liquid Template Rendering', () => {
192
164
  this.skip();
193
165
  }
194
166
 
195
- const dataFormatsPage = new GuidePage('/docs/redirects/guide/orders-api-overview.html');
196
- dataFormatsPage.open();
167
+ const dataFormatsPage = new GuidePage('/docs/redirects-url/guide/orders-api-overview.html');
168
+ await browser.url(dataFormatsPage.path);
197
169
  await dataFormatsPage.waitPageLoad();
198
170
 
199
171
  const content = await $('>>>doc-content-layout');
@@ -212,7 +184,7 @@ describe('Liquid Template Rendering', () => {
212
184
  }
213
185
 
214
186
  const futurePage = new GuidePage('/docs/liquid-project/guide/future-topic.html');
215
- futurePage.open();
187
+ await browser.url(futurePage.path);
216
188
  await futurePage.waitPageLoad();
217
189
 
218
190
  const content = await $('>>>doc-content-layout');
@@ -228,7 +200,7 @@ describe('Liquid Template Rendering', () => {
228
200
  }
229
201
 
230
202
  const englishOnlyPage = new GuidePage('/docs/liquid-project/guide/english-only-topic.html');
231
- englishOnlyPage.open();
203
+ await browser.url(englishOnlyPage.path);
232
204
  await englishOnlyPage.waitPageLoad();
233
205
 
234
206
  const content = await $('>>>doc-content-layout');
@@ -238,7 +210,7 @@ describe('Liquid Template Rendering', () => {
238
210
  expect(text.includes('filters: [englishonly]')).toBeTruthy();
239
211
  });
240
212
 
241
- it('Should not process Liquid when frontmatter has liquid.enabled as false', async function () {
213
+ it('Should not render raw Liquid syntax when Liquid processing is disabled', async function () {
242
214
  if (!liquidEnabled) {
243
215
  this.skip();
244
216
  }
@@ -246,7 +218,7 @@ describe('Liquid Template Rendering', () => {
246
218
  const disabledPage = new GuidePage(
247
219
  '/docs/liquid-project/guide/liquid-learning-resources.html',
248
220
  );
249
- disabledPage.open();
221
+ await browser.url(disabledPage.path);
250
222
  await disabledPage.waitPageLoad();
251
223
 
252
224
  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
+ // Liquid tests require previewFuture, variables, and redirects-url project — not in static build
22
+ './src/shared/specs/liquid.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