@salesforcedevs/sfdocs-e2e 1.0.10-alpha → 1.0.11-toolbar.0
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 +1 -1
- package/portal-wdio.conf.js +5 -0
- package/src/content-repo/pageobjects/home.page.ts +6 -35
- package/src/content-repo/specs/guideAndReferencePage.test.ts +17 -31
- package/src/content-repo/specs/homepage.test.ts +35 -20
- package/src/content-repo/specs/navHeader.test.ts +3 -6
- package/src/content-repo/specs/sitemap.test.ts +84 -0
- package/src/portal/specs/docs.api.test.ts +0 -43
- package/src/shared/pageobjects/api-redoc-reference.page.ts +5 -0
- package/src/shared/pageobjects/content-action-toolbar.ts +104 -0
- package/src/shared/pageobjects/docs-content-layout.ts +6 -7
- package/src/shared/pageobjects/docs.page.ts +128 -0
- package/src/shared/pageobjects/page.ts +0 -16
- package/src/shared/pageobjects/reference.page.ts +9 -0
- package/src/shared/specs/contentActionToolbar.test.ts +164 -0
- package/src/shared/specs/docsContentType.test.ts +615 -0
- package/src/shared/specs/guides.test.ts +1 -1
- package/src/shared/specs/liquid-advanced.test.ts +110 -0
- package/src/shared/specs/liquid.test.ts +192 -22
- package/src/shared/specs/redoc-reference.test.ts +143 -0
- package/src/shared/specs/video.test.ts +4 -1
- package/static-dsc-portal-wdio.conf.js +1 -0
- package/static-portal-wdio.conf.js +2 -0
- package/wdio.conf.js +1 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import DocsPage from '../pageobjects/docs.page';
|
|
2
|
+
import GuidePage from '../pageobjects/guide.page';
|
|
3
|
+
|
|
4
|
+
let page: GuidePage;
|
|
5
|
+
let liquidEnabled = false;
|
|
6
|
+
|
|
7
|
+
describe('Liquid Template Rendering — Advanced', () => {
|
|
8
|
+
before(async () => {
|
|
9
|
+
try {
|
|
10
|
+
page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
|
|
11
|
+
await browser.url(page.path);
|
|
12
|
+
await page.waitPageLoad();
|
|
13
|
+
|
|
14
|
+
const content = await $('>>>doc-content-layout');
|
|
15
|
+
const text = await content.getText();
|
|
16
|
+
|
|
17
|
+
liquidEnabled = text.includes('Hello from data.yaml');
|
|
18
|
+
} catch (e) {
|
|
19
|
+
liquidEnabled = false;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
beforeEach(async () => {
|
|
24
|
+
if (liquidEnabled) {
|
|
25
|
+
page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
|
|
26
|
+
await browser.url(page.path);
|
|
27
|
+
await page.waitPageLoad();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('Should render future block content when previewFuture is enabled', async function () {
|
|
32
|
+
if (!liquidEnabled) {
|
|
33
|
+
this.skip();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const content = await $('>>>doc-content-layout');
|
|
37
|
+
const text = await content.getText();
|
|
38
|
+
|
|
39
|
+
expect(text.includes('Coming Soon')).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('Should render the future topic page when previewFuture is enabled', async function () {
|
|
43
|
+
if (!liquidEnabled) {
|
|
44
|
+
this.skip();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const futurePage = new GuidePage('/docs/liquid-project/guide/future-topic.html');
|
|
48
|
+
await browser.url(futurePage.path);
|
|
49
|
+
await futurePage.waitPageLoad();
|
|
50
|
+
|
|
51
|
+
const content = await $('>>>doc-content-layout');
|
|
52
|
+
const text = await content.getText();
|
|
53
|
+
|
|
54
|
+
expect(text.includes('Future Feature')).toBeTruthy();
|
|
55
|
+
expect(text.includes('previewFuture')).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('Docs content type > future filter', () => {
|
|
60
|
+
let docsFutureEnabled = false;
|
|
61
|
+
const overviewPath = '/docs/docs-content-type-example/get-started.html';
|
|
62
|
+
|
|
63
|
+
before(async () => {
|
|
64
|
+
try {
|
|
65
|
+
const docsPage = new DocsPage(overviewPath);
|
|
66
|
+
docsPage.open();
|
|
67
|
+
await docsPage.waitPageLoad();
|
|
68
|
+
|
|
69
|
+
const content = await $('>>>doc-content-layout');
|
|
70
|
+
const text = await content.getText();
|
|
71
|
+
|
|
72
|
+
docsFutureEnabled = text.includes(
|
|
73
|
+
'hidden in production and excluded from localization unless',
|
|
74
|
+
);
|
|
75
|
+
} catch (e) {
|
|
76
|
+
docsFutureEnabled = false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('renders an inline future block when previewFuture is enabled', async function () {
|
|
81
|
+
if (!docsFutureEnabled) {
|
|
82
|
+
this.skip();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const docsPage = new DocsPage(overviewPath);
|
|
86
|
+
docsPage.open();
|
|
87
|
+
await docsPage.waitPageLoad();
|
|
88
|
+
|
|
89
|
+
const content = await $('>>>doc-content-layout');
|
|
90
|
+
const text = await content.getText();
|
|
91
|
+
const html = await content.getHTML();
|
|
92
|
+
|
|
93
|
+
expect(text).toContain('hidden in production and excluded from localization unless');
|
|
94
|
+
expect(html).not.toContain('{% future');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('renders the future topic page when previewFuture is enabled', async function () {
|
|
98
|
+
if (!docsFutureEnabled) {
|
|
99
|
+
this.skip();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const docsPage = new DocsPage('/docs/docs-content-type-example/upcoming-graphql.html');
|
|
103
|
+
docsPage.open();
|
|
104
|
+
await docsPage.waitPageLoad();
|
|
105
|
+
|
|
106
|
+
expect(await (await docsPage.getContentHeading()).getText()).toContain(
|
|
107
|
+
'Upcoming: GraphQL API',
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -7,7 +7,7 @@ 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.
|
|
10
|
+
await browser.url(page.path);
|
|
11
11
|
await page.waitPageLoad();
|
|
12
12
|
|
|
13
13
|
const content = await $('>>>doc-content-layout');
|
|
@@ -16,9 +16,9 @@ describe('Liquid Template Rendering', () => {
|
|
|
16
16
|
|
|
17
17
|
const hasLiquidOutput = text.includes('Hello from data.yaml');
|
|
18
18
|
const hasRawSyntax =
|
|
19
|
-
html.includes('{
|
|
20
|
-
html.includes('{
|
|
21
|
-
|
|
19
|
+
html.includes('{% assign') ||
|
|
20
|
+
html.includes('{% include') ||
|
|
21
|
+
html.includes('{{ data.greeting }}');
|
|
22
22
|
|
|
23
23
|
if (hasRawSyntax) {
|
|
24
24
|
liquidEnabled = false;
|
|
@@ -35,7 +35,7 @@ describe('Liquid Template Rendering', () => {
|
|
|
35
35
|
beforeEach(async () => {
|
|
36
36
|
if (liquidEnabled) {
|
|
37
37
|
page = new GuidePage('/docs/liquid-project/guide/liquid-quickstart.html');
|
|
38
|
-
page.
|
|
38
|
+
await browser.url(page.path);
|
|
39
39
|
await page.waitPageLoad();
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -50,10 +50,21 @@ describe('Liquid Template Rendering', () => {
|
|
|
50
50
|
|
|
51
51
|
expect(text.includes('GitHub for writers')).toBeTruthy();
|
|
52
52
|
expect(text.includes('Hello from data.yaml')).toBeTruthy();
|
|
53
|
+
});
|
|
53
54
|
|
|
55
|
+
it('Should render repository-level variables from content-config.yml', async function () {
|
|
56
|
+
if (!liquidEnabled) {
|
|
57
|
+
this.skip();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const content = await $('>>>doc-content-layout');
|
|
61
|
+
const text = await content.getText();
|
|
54
62
|
const html = await content.getHTML();
|
|
55
|
-
|
|
56
|
-
expect(
|
|
63
|
+
|
|
64
|
+
expect(text.includes('Salesforce Platform')).toBeTruthy();
|
|
65
|
+
expect(text.includes('62.0')).toBeTruthy();
|
|
66
|
+
expect(text.includes('sf')).toBeTruthy();
|
|
67
|
+
expect(html.includes('{{ variables.platform')).toBeFalsy();
|
|
57
68
|
});
|
|
58
69
|
|
|
59
70
|
it('Should render included templates from shared directory', async function () {
|
|
@@ -86,27 +97,29 @@ describe('Liquid Template Rendering', () => {
|
|
|
86
97
|
const listItems = await content.$$('li');
|
|
87
98
|
expect(listItems.length).toBeGreaterThan(5);
|
|
88
99
|
|
|
89
|
-
expect(
|
|
90
|
-
expect(html.includes('
|
|
91
|
-
expect(html.includes('{% endfor')).toBeFalsy();
|
|
100
|
+
expect(text.includes('supported_calls')).toBeFalsy();
|
|
101
|
+
expect(html.includes('for call in supported_calls')).toBeFalsy();
|
|
92
102
|
});
|
|
93
103
|
|
|
94
|
-
it('Should
|
|
104
|
+
it('Should resolve {{ }} outputs inside code blocks but keep {% %} tags literal', async function () {
|
|
95
105
|
if (!liquidEnabled) {
|
|
96
106
|
this.skip();
|
|
97
107
|
}
|
|
98
108
|
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
const codeBlock = await content.$('code');
|
|
109
|
+
const codeBlockElement = await $('>>>.code-block-content');
|
|
110
|
+
const codeBlock = await codeBlockElement.shadow$('code');
|
|
102
111
|
|
|
103
112
|
expect(await codeBlock.isExisting()).toBeTruthy();
|
|
104
113
|
|
|
105
|
-
const
|
|
106
|
-
expect(
|
|
107
|
-
expect(
|
|
108
|
-
expect(
|
|
114
|
+
const codeText = await codeBlock.getText();
|
|
115
|
+
expect(codeText.includes('{{ data.greeting }}')).toBeFalsy();
|
|
116
|
+
expect(codeText.includes('{{ topic }}')).toBeFalsy();
|
|
117
|
+
expect(codeText.includes('Hello from data.yaml')).toBeTruthy();
|
|
118
|
+
expect(codeText.includes('GitHub for writers')).toBeTruthy();
|
|
119
|
+
expect(codeText.includes('{% for item in items %}')).toBeTruthy();
|
|
120
|
+
expect(codeText.includes('{{ item }}')).toBeTruthy();
|
|
109
121
|
|
|
122
|
+
const content = await $('>>>doc-content-layout');
|
|
110
123
|
const text = await content.getText();
|
|
111
124
|
expect(text.includes('Visit')).toBeTruthy();
|
|
112
125
|
});
|
|
@@ -131,16 +144,76 @@ describe('Liquid Template Rendering', () => {
|
|
|
131
144
|
expect(html.includes('{{ id2 }}')).toBeFalsy();
|
|
132
145
|
});
|
|
133
146
|
|
|
134
|
-
it('Should
|
|
147
|
+
it('Should render englishonly block content in production', async function () {
|
|
148
|
+
if (!liquidEnabled) {
|
|
149
|
+
this.skip();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const content = await $('>>>doc-content-layout');
|
|
153
|
+
const text = await content.getText();
|
|
154
|
+
const html = await content.getHTML();
|
|
155
|
+
|
|
156
|
+
expect(text.includes('This feature is currently only available in English')).toBeTruthy();
|
|
157
|
+
expect(html.includes('{% englishonly')).toBeFalsy();
|
|
158
|
+
expect(html.includes('{% endenglishonly')).toBeFalsy();
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('Should render liquid.data string format — single YAML file on root context', async function () {
|
|
162
|
+
if (!liquidEnabled) {
|
|
163
|
+
this.skip();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const content = await $('>>>doc-content-layout');
|
|
167
|
+
const text = await content.getText();
|
|
168
|
+
|
|
169
|
+
expect(text.includes('Hello from data.yaml')).toBeTruthy();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('Should render liquid.data object format — multiple YAML files each under a named key', async function () {
|
|
173
|
+
if (!liquidEnabled) {
|
|
174
|
+
this.skip();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const multiDataPage = new GuidePage('/docs/liquid-project/guide/multi-data.html');
|
|
178
|
+
await browser.url(multiDataPage.path);
|
|
179
|
+
await multiDataPage.waitPageLoad();
|
|
180
|
+
|
|
181
|
+
const content = await $('>>>doc-content-layout');
|
|
182
|
+
const text = await content.getText();
|
|
183
|
+
const html = await content.getHTML();
|
|
184
|
+
|
|
185
|
+
expect(text.includes('Sample data file to check the multi-include')).toBeTruthy();
|
|
186
|
+
expect(html.includes('{{ two.summary }}')).toBeFalsy();
|
|
187
|
+
expect(html.includes('{{ data.one.summary }}')).toBeFalsy();
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('Should render the englishonly topic page', async function () {
|
|
135
191
|
if (!liquidEnabled) {
|
|
136
192
|
this.skip();
|
|
137
193
|
}
|
|
138
194
|
|
|
139
|
-
const
|
|
195
|
+
const englishOnlyPage = new GuidePage('/docs/liquid-project/guide/english-only-topic.html');
|
|
196
|
+
await browser.url(englishOnlyPage.path);
|
|
197
|
+
await englishOnlyPage.waitPageLoad();
|
|
198
|
+
|
|
199
|
+
const content = await $('>>>doc-content-layout');
|
|
200
|
+
const text = await content.getText();
|
|
201
|
+
|
|
202
|
+
expect(text.includes('English-Only Topic')).toBeTruthy();
|
|
203
|
+
expect(text.includes('filters: [englishonly]')).toBeTruthy();
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('Should render a file with no Liquid syntax as plain markdown', async function () {
|
|
207
|
+
if (!liquidEnabled) {
|
|
208
|
+
this.skip();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const plainPage = new GuidePage(
|
|
140
212
|
'/docs/liquid-project/guide/liquid-learning-resources.html',
|
|
141
213
|
);
|
|
142
|
-
|
|
143
|
-
await
|
|
214
|
+
|
|
215
|
+
await browser.url(plainPage.path);
|
|
216
|
+
await plainPage.waitPageLoad();
|
|
144
217
|
|
|
145
218
|
const content = await $('>>>doc-content-layout');
|
|
146
219
|
const text = await content.getText();
|
|
@@ -149,3 +222,100 @@ describe('Liquid Template Rendering', () => {
|
|
|
149
222
|
expect(text.includes('Liquid is a templating language supported in SFDocs')).toBeTruthy();
|
|
150
223
|
});
|
|
151
224
|
});
|
|
225
|
+
|
|
226
|
+
describe('Liquid Template Rendering — Localized (ja-jp)', () => {
|
|
227
|
+
let jaLiquidEnabled = false;
|
|
228
|
+
const quickstartPath = '/docs/ja-jp/liquid-project/guide/liquid-quickstart.html';
|
|
229
|
+
|
|
230
|
+
before(async () => {
|
|
231
|
+
try {
|
|
232
|
+
page = new GuidePage(quickstartPath);
|
|
233
|
+
await browser.url(page.path);
|
|
234
|
+
await page.waitPageLoad();
|
|
235
|
+
|
|
236
|
+
const content = await $('>>>doc-content-layout');
|
|
237
|
+
const text = await content.getText();
|
|
238
|
+
const html = await content.getHTML();
|
|
239
|
+
|
|
240
|
+
const hasLiquidOutput = text.includes('data.yaml からこんにちは');
|
|
241
|
+
const hasRawSyntax =
|
|
242
|
+
html.includes('{% assign topic') || html.includes('{{ data.greeting }}');
|
|
243
|
+
|
|
244
|
+
jaLiquidEnabled = hasLiquidOutput && !hasRawSyntax;
|
|
245
|
+
} catch (e) {
|
|
246
|
+
jaLiquidEnabled = false;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
beforeEach(async () => {
|
|
251
|
+
if (jaLiquidEnabled) {
|
|
252
|
+
page = new GuidePage(quickstartPath);
|
|
253
|
+
await browser.url(page.path);
|
|
254
|
+
await page.waitPageLoad();
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('Should render frontmatter assigns and data.yaml values in Japanese', async function () {
|
|
259
|
+
if (!jaLiquidEnabled) {
|
|
260
|
+
this.skip();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const content = await $('>>>doc-content-layout');
|
|
264
|
+
const text = await content.getText();
|
|
265
|
+
|
|
266
|
+
expect(text.includes('ライターのための GitHub')).toBeTruthy();
|
|
267
|
+
expect(text.includes('data.yaml からこんにちは')).toBeTruthy();
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('Should render repository-level variables in a localized topic', async function () {
|
|
271
|
+
if (!jaLiquidEnabled) {
|
|
272
|
+
this.skip();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const content = await $('>>>doc-content-layout');
|
|
276
|
+
const text = await content.getText();
|
|
277
|
+
const html = await content.getHTML();
|
|
278
|
+
|
|
279
|
+
expect(text.includes('Salesforce Platform')).toBeTruthy();
|
|
280
|
+
expect(text.includes('62.0')).toBeTruthy();
|
|
281
|
+
expect(html.includes('{{ variables.platform')).toBeFalsy();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('Should render a loop and an included partial capture block in Japanese', async function () {
|
|
285
|
+
if (!jaLiquidEnabled) {
|
|
286
|
+
this.skip();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const content = await $('>>>doc-content-layout');
|
|
290
|
+
const text = await content.getText();
|
|
291
|
+
const html = await content.getHTML();
|
|
292
|
+
|
|
293
|
+
expect(text.includes('create()')).toBeTruthy();
|
|
294
|
+
expect(text.includes('再利用可能なヒント')).toBeTruthy();
|
|
295
|
+
expect(
|
|
296
|
+
text.includes('ウィジェットは Widgets API を通じて作成および管理されます'),
|
|
297
|
+
).toBeTruthy();
|
|
298
|
+
// Dash-form tags are the fixture's real (resolved) tags; the bare "{% include %}"
|
|
299
|
+
// in the prose renders as literal inline code, so assert on the dash form only.
|
|
300
|
+
expect(html.includes('{%- include')).toBeFalsy();
|
|
301
|
+
expect(html.includes('{%- capture')).toBeFalsy();
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('Should render liquid.data object format in a localized topic', async function () {
|
|
305
|
+
if (!jaLiquidEnabled) {
|
|
306
|
+
this.skip();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const multiDataPage = new GuidePage('/docs/ja-jp/liquid-project/guide/multi-data.html');
|
|
310
|
+
await browser.url(multiDataPage.path);
|
|
311
|
+
await multiDataPage.waitPageLoad();
|
|
312
|
+
|
|
313
|
+
const content = await $('>>>doc-content-layout');
|
|
314
|
+
const text = await content.getText();
|
|
315
|
+
const html = await content.getHTML();
|
|
316
|
+
|
|
317
|
+
expect(text.includes('小売店舗や顧客サイト')).toBeTruthy();
|
|
318
|
+
expect(html.includes('{{ data.one.summary }}')).toBeFalsy();
|
|
319
|
+
expect(html.includes('{{ two.summary }}')).toBeFalsy();
|
|
320
|
+
});
|
|
321
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { it } from 'mocha';
|
|
2
2
|
import RedocApisPage from '../pageobjects/api-redoc-reference.page';
|
|
3
3
|
import OverviewPage from '../pageobjects/overview.page';
|
|
4
|
+
import { ReferencePage } from '../pageobjects/reference.page';
|
|
4
5
|
import {
|
|
5
6
|
waitAndGetDocPhaseParentInRedocReferencesPage,
|
|
6
7
|
assertDocPhaseUnavailability,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
} from '../pageobjects/doc-phase-config';
|
|
10
11
|
|
|
11
12
|
let page: RedocApisPage;
|
|
13
|
+
let refPage: ReferencePage;
|
|
12
14
|
describe('Redoc API Reference page', () => {
|
|
13
15
|
describe('check layouts', () => {
|
|
14
16
|
before(async () => {
|
|
@@ -167,4 +169,145 @@ describe('Redoc API Reference page', () => {
|
|
|
167
169
|
expect(await heading.isDisplayedInViewport()).toBe(true);
|
|
168
170
|
});
|
|
169
171
|
});
|
|
172
|
+
|
|
173
|
+
describe('Flexible References with Redoc Rendering', () => {
|
|
174
|
+
describe('All references view', () => {
|
|
175
|
+
before(async () => {
|
|
176
|
+
refPage = new ReferencePage('docs/service/multi-oas-redoc/references');
|
|
177
|
+
refPage.open();
|
|
178
|
+
|
|
179
|
+
await refPage.waitForMarkdownBasedReferencePageLoad();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('should display all reference titles in LNB', async () => {
|
|
183
|
+
const treeItems = await refPage.getSidebarItems();
|
|
184
|
+
|
|
185
|
+
expect(treeItems.length).toEqual(3);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it('should show arrow button after OAS reference titles', async () => {
|
|
189
|
+
const sideBarContent = await refPage.getSidebarItems();
|
|
190
|
+
|
|
191
|
+
const secondItem = sideBarContent[1];
|
|
192
|
+
const treeItem = await secondItem.shadow$('dx-tree-item');
|
|
193
|
+
const treeTile = await treeItem.shadow$('a > dx-tree-tile');
|
|
194
|
+
const arrowIcon = await treeTile.shadow$(
|
|
195
|
+
'a > div[role="heading"] > div.tile-forward-arrow',
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
expect(await arrowIcon.isExisting()).toBeTruthy();
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe('Navigation and content verification', () => {
|
|
203
|
+
it('should display markdown content when first reference is clicked', async () => {
|
|
204
|
+
const sideBarContent = await refPage.getSidebarItems();
|
|
205
|
+
const firstItem = sideBarContent[0];
|
|
206
|
+
const treeItem = await firstItem.shadow$('dx-tree-item');
|
|
207
|
+
await treeItem.click();
|
|
208
|
+
|
|
209
|
+
const contentLayout = await $('>>>doc-content-layout');
|
|
210
|
+
await contentLayout.waitForDisplayed();
|
|
211
|
+
|
|
212
|
+
expect(await contentLayout.isDisplayed()).toBeTruthy();
|
|
213
|
+
|
|
214
|
+
const heading = await $('>>>h1');
|
|
215
|
+
const headingText = await heading.getText();
|
|
216
|
+
|
|
217
|
+
expect(headingText).toEqual('Metamind API references');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('should display Redoc UI when OAS reference is clicked', async () => {
|
|
221
|
+
await browser.url('/docs/service/multi-oas-redoc/references');
|
|
222
|
+
await refPage.waitForMarkdownBasedReferencePageLoad();
|
|
223
|
+
|
|
224
|
+
const sideBarContent = await refPage.getSidebarItems();
|
|
225
|
+
const secondItem = sideBarContent[1];
|
|
226
|
+
const treeItem = await secondItem.shadow$('dx-tree-item');
|
|
227
|
+
await treeItem.click();
|
|
228
|
+
|
|
229
|
+
const redocContainer = await $('doc-redoc-reference > .redoc-container');
|
|
230
|
+
await redocContainer.waitForDisplayed({ timeout: 30000 });
|
|
231
|
+
|
|
232
|
+
expect(await redocContainer.isDisplayed()).toBeTruthy();
|
|
233
|
+
|
|
234
|
+
page = new RedocApisPage(
|
|
235
|
+
'docs/service/multi-oas-redoc/references/redoc-orders-multiple',
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('should have the correct api info title', async () => {
|
|
240
|
+
const apiTitle = await page.getApiTitle();
|
|
241
|
+
const titleText = await apiTitle.getText();
|
|
242
|
+
|
|
243
|
+
expect(titleText).toMatch('Einstein Vision and Einstein Language');
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('should display current reference title and "All References" with back arrow in LNB', async () => {
|
|
247
|
+
const projectHeaderContainer = await page.getProjectHeader();
|
|
248
|
+
|
|
249
|
+
const backButton = await projectHeaderContainer.$('a.redoc-project-back');
|
|
250
|
+
const allReference = await backButton.$('span.redoc-project-title');
|
|
251
|
+
const specTitle = await projectHeaderContainer.$('h2.redoc-spec-title');
|
|
252
|
+
|
|
253
|
+
expect(await allReference.getText()).toEqual('All Reference');
|
|
254
|
+
expect(await backButton.isExisting()).toBeTruthy();
|
|
255
|
+
expect(await specTitle.getText()).toEqual('Orders API');
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
describe('Navigation back to all references', () => {
|
|
260
|
+
before(async () => {
|
|
261
|
+
page = new RedocApisPage(
|
|
262
|
+
'docs/service/multi-oas-redoc/references/redoc-orders-multiple',
|
|
263
|
+
);
|
|
264
|
+
page.open();
|
|
265
|
+
await page.waitPageLoad();
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
it('should navigate back to main URL when back arrow is clicked', async () => {
|
|
269
|
+
const projectHeaderContainer = await page.getProjectHeader();
|
|
270
|
+
const backButton = await projectHeaderContainer.$('a.redoc-project-back');
|
|
271
|
+
|
|
272
|
+
await backButton.click();
|
|
273
|
+
|
|
274
|
+
const contentLayout = await $('>>>doc-content-layout');
|
|
275
|
+
await contentLayout.waitForDisplayed();
|
|
276
|
+
|
|
277
|
+
const currentUrl = await browser.getUrl();
|
|
278
|
+
|
|
279
|
+
expect(currentUrl).toContain('/docs/service/multi-oas-redoc/references');
|
|
280
|
+
expect(currentUrl).not.toContain('redoc-orders-multiple');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('should display all references in LNB after navigating back', async () => {
|
|
284
|
+
refPage = new ReferencePage('/docs/service/multi-oas-redoc/references');
|
|
285
|
+
const treeItems = await refPage.getSidebarItems();
|
|
286
|
+
|
|
287
|
+
expect(treeItems.length).toEqual(3);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('should navigate to third reference when clicked', async () => {
|
|
291
|
+
const sideBarContent = await refPage.getSidebarItems();
|
|
292
|
+
const thirdItem = sideBarContent[2];
|
|
293
|
+
const treeItem = await thirdItem.shadow$('dx-tree-item');
|
|
294
|
+
await treeItem.click();
|
|
295
|
+
|
|
296
|
+
const redocContainer = await $('doc-redoc-reference > .redoc-container');
|
|
297
|
+
await redocContainer.waitForDisplayed({ timeout: 30000 });
|
|
298
|
+
|
|
299
|
+
expect(await redocContainer.isDisplayed()).toBeTruthy();
|
|
300
|
+
expect(await browser.getUrl()).toContain('redoc-quip-admin-api');
|
|
301
|
+
|
|
302
|
+
page = new RedocApisPage(
|
|
303
|
+
'docs/service/multi-oas-redoc/references/redoc-quip-admin-api',
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
const apiTitle = await page.getApiTitle();
|
|
307
|
+
const titleText = await apiTitle.getText();
|
|
308
|
+
|
|
309
|
+
expect(titleText).toMatch('Quip Admin API');
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
});
|
|
170
313
|
});
|
|
@@ -24,8 +24,11 @@ describe('Video Plugin Scenarios ', () => {
|
|
|
24
24
|
expect(await videoTitle?.getText()).toBe('Video from YouTube');
|
|
25
25
|
const videoContainer = await videoRootElement?.$('.video-plugin-container');
|
|
26
26
|
const iframeElement = await videoContainer?.$('iframe');
|
|
27
|
+
// The video plugin normalizes the YouTube host to www.youtube.com to
|
|
28
|
+
// avoid a cross-origin redirect that would drop the iframe's fullscreen
|
|
29
|
+
// grant (W-23222416). The authored src is `https://youtube.com/...`.
|
|
27
30
|
expect(await iframeElement?.getAttribute('src')).toBe(
|
|
28
|
-
'https://youtube.com/embed/di6iwHhrH6s',
|
|
31
|
+
'https://www.youtube.com/embed/di6iwHhrH6s',
|
|
29
32
|
);
|
|
30
33
|
});
|
|
31
34
|
});
|
|
@@ -18,6 +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
|
+
// Advanced liquid tests require previewFuture, variables — not in static build
|
|
22
|
+
'./src/shared/specs/liquid-advanced.test.ts',
|
|
21
23
|
// /docs/apis landing page doesn't exist in static builds
|
|
22
24
|
'./src/portal/specs/docs.api.test.ts',
|
|
23
25
|
// /docs landing page doesn't exist in static builds
|
package/wdio.conf.js
CHANGED