@salesforcedevs/sfdocs-e2e 0.6.132-linkfix-alpha
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/README.md +63 -0
- package/bin/run-e2e.js +115 -0
- package/common-wdio.conf.js +402 -0
- package/package.json +40 -0
- package/portal-wdio.conf.js +7 -0
- package/search-wdio.conf.js +10 -0
- package/src/content-repo/pageobjects/home.page.ts +55 -0
- package/src/content-repo/specs/componentSpecification.test.ts +287 -0
- package/src/content-repo/specs/guideAndReferencePage.test.ts +46 -0
- package/src/content-repo/specs/homepage.test.ts +47 -0
- package/src/content-repo/specs/media-mapper.test.ts +18 -0
- package/src/content-repo/specs/navHeader.test.ts +79 -0
- package/src/content-repo/specs/sitemap.test.ts +58 -0
- package/src/content-repo/specs/tabset.test.ts +81 -0
- package/src/portal/pageobjects/docs.apis.page.ts +23 -0
- package/src/portal/pageobjects/docs.page.ts +18 -0
- package/src/portal/pageobjects/help-page/ScopeSeachTest.page.ts +20 -0
- package/src/portal/specs/docs.api.test.ts +68 -0
- package/src/portal/specs/docs.test.ts +84 -0
- package/src/portal/specs/media-mapper.test.ts +42 -0
- package/src/portal/specs/scope.search.guide.test.ts +33 -0
- package/src/portal/specs/scope.search.reference.test.ts +37 -0
- package/src/shared/pageobjects/api-redoc-reference.page.ts +40 -0
- package/src/shared/pageobjects/callout.ts +24 -0
- package/src/shared/pageobjects/doc-phase-config.ts +106 -0
- package/src/shared/pageobjects/docs-content-layout.ts +17 -0
- package/src/shared/pageobjects/error.page.ts +14 -0
- package/src/shared/pageobjects/guide.page.ts +24 -0
- package/src/shared/pageobjects/overview.page.ts +20 -0
- package/src/shared/pageobjects/page.ts +115 -0
- package/src/shared/pageobjects/reference.page.ts +41 -0
- package/src/shared/specs/anchorHeading.test.ts +21 -0
- package/src/shared/specs/banner.test.ts +66 -0
- package/src/shared/specs/breadcrumbs.test.ts +45 -0
- package/src/shared/specs/calloutContent.test.ts +102 -0
- package/src/shared/specs/codeBlock.test.ts +44 -0
- package/src/shared/specs/devCenterLink.test.ts +42 -0
- package/src/shared/specs/docPhase.test.ts +127 -0
- package/src/shared/specs/errorRoutes.test.ts +24 -0
- package/src/shared/specs/guides.test.ts +333 -0
- package/src/shared/specs/layout-tests.ts +38 -0
- package/src/shared/specs/overview.test.ts +82 -0
- package/src/shared/specs/page-title.test.ts +12 -0
- package/src/shared/specs/redoc-reference.test.ts +170 -0
- package/src/shared/specs/reference.test.ts +281 -0
- package/src/shared/specs/video.test.ts +31 -0
- package/static-portal-wdio.conf.js +50 -0
- package/tsconfig.json +26 -0
- package/wdio.conf.js +6 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Page from '../../shared/pageobjects/page';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* sub page containing specific selectors and methods for a specific page
|
|
5
|
+
*/
|
|
6
|
+
export class HomePage extends Page {
|
|
7
|
+
get projectCards(): Promise<WebdriverIO.ElementArray> {
|
|
8
|
+
return $('dx-section')
|
|
9
|
+
.then((section) => section.$('dx-grid'))
|
|
10
|
+
.then((grid) => grid.$$('dx-card-docs'));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get projectCardsWithGuides(): Promise<WebdriverIO.ElementArray | WebdriverIO.Element[]> {
|
|
14
|
+
return this.projectCards.then((cards: WebdriverIO.ElementArray) => {
|
|
15
|
+
return cards.filter((card: WebdriverIO.Element) => {
|
|
16
|
+
return card.$('dx-button[href*=guide]').then((guideLink) => guideLink.isExisting());
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get projectCardsWithReferences(): Promise<WebdriverIO.ElementArray | WebdriverIO.Element[]> {
|
|
22
|
+
return this.projectCards.then((cards) =>
|
|
23
|
+
cards.filter((card) =>
|
|
24
|
+
card.$('dx-button[href*=references]').then((link) => link.isExisting()),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async getProjectCardWithTitle(title: string): Promise<WebdriverIO.Element | undefined> {
|
|
30
|
+
const projectCards = await this.projectCards;
|
|
31
|
+
for (let i = 0; i < projectCards.length; i++) {
|
|
32
|
+
const projectCard = projectCards[i];
|
|
33
|
+
const titleValue = await projectCard.getAttribute('header');
|
|
34
|
+
if (titleValue === title) {
|
|
35
|
+
return projectCard;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
navigateToContentTypeWithProjectTitle =
|
|
41
|
+
(projectTitle: string) =>
|
|
42
|
+
async (contentType: string): Promise<void> => {
|
|
43
|
+
const projectCard = await this.getProjectCardWithTitle(projectTitle);
|
|
44
|
+
if (projectCard) {
|
|
45
|
+
const contentTypeButton = await projectCard.$(`dx-button[href*=${contentType}]`);
|
|
46
|
+
await contentTypeButton.click();
|
|
47
|
+
} else {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Project with title "${projectTitle}" is not available, Please check the content-config`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default new HomePage();
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import Page from '../../shared/pageobjects/page';
|
|
2
|
+
|
|
3
|
+
let page: Page;
|
|
4
|
+
|
|
5
|
+
describe('Component Specification', () => {
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
page = new Page();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('LWC Component Specifications', () => {
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
await page.open('docs/lightning-design-system/guide/button.html');
|
|
13
|
+
await page.waitForLwcGuidePageLoad();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should display all tabs correctly', async () => {
|
|
17
|
+
const tabs = await page.waitForTabsLoad();
|
|
18
|
+
expect(tabs.length).toBeGreaterThan(0);
|
|
19
|
+
|
|
20
|
+
const tabTexts = await Promise.all(
|
|
21
|
+
tabs.map((tab: WebdriverIO.Element) => tab.getText()),
|
|
22
|
+
);
|
|
23
|
+
expect(tabTexts).toContain('Design');
|
|
24
|
+
expect(tabTexts).toContain('Develop');
|
|
25
|
+
expect(tabTexts).toContain('Specification');
|
|
26
|
+
expect(tabTexts).toContain('Accessibility');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should switch to Specification tab successfully', async () => {
|
|
30
|
+
const tabs = await page.waitForTabsLoad();
|
|
31
|
+
await tabs[2].click();
|
|
32
|
+
|
|
33
|
+
const activeTab = await $('>>>button.tab-active');
|
|
34
|
+
const activeTabText = await activeTab.getText();
|
|
35
|
+
expect(activeTabText).toBe('Specification');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should validate component specification attributes', async () => {
|
|
39
|
+
const tabs = await page.waitForTabsLoad();
|
|
40
|
+
await tabs[2].click();
|
|
41
|
+
|
|
42
|
+
const specContent = await page.waitForSpecificationContent();
|
|
43
|
+
expect(await specContent.isExisting()).toBeTruthy();
|
|
44
|
+
|
|
45
|
+
const componentAttr = await specContent.getAttribute('component');
|
|
46
|
+
expect(componentAttr).toBe('button');
|
|
47
|
+
|
|
48
|
+
const modelAttr = await specContent.getAttribute('model');
|
|
49
|
+
expect(modelAttr).toBe('lwc');
|
|
50
|
+
|
|
51
|
+
const namespaceAttr = await specContent.getAttribute('namespace');
|
|
52
|
+
expect(namespaceAttr).toBe('lightning');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should validate basic component specification functionality', async () => {
|
|
56
|
+
const tabs = await page.waitForTabsLoad();
|
|
57
|
+
await tabs[2].click();
|
|
58
|
+
|
|
59
|
+
const specContent = await page.waitForSpecificationContent();
|
|
60
|
+
|
|
61
|
+
const specPropertiesDiv = await specContent.shadow$('.specification-properties');
|
|
62
|
+
expect(await specPropertiesDiv.isExisting()).toBeTruthy();
|
|
63
|
+
|
|
64
|
+
await page.waitForSpinnerToDisappear(specPropertiesDiv);
|
|
65
|
+
|
|
66
|
+
const tables = await specPropertiesDiv.$$('table');
|
|
67
|
+
expect(tables.length).toBe(2);
|
|
68
|
+
|
|
69
|
+
const docHeadings = await specPropertiesDiv.$$('doc-heading');
|
|
70
|
+
expect(docHeadings.length).toBeGreaterThan(0);
|
|
71
|
+
|
|
72
|
+
const headingTexts = await Promise.all(
|
|
73
|
+
docHeadings.map(async (heading: WebdriverIO.Element) =>
|
|
74
|
+
(await heading.getText()).trim(),
|
|
75
|
+
),
|
|
76
|
+
);
|
|
77
|
+
expect(headingTexts).toContain('Attributes');
|
|
78
|
+
expect(headingTexts).toContain('Methods');
|
|
79
|
+
|
|
80
|
+
const table = tables[0];
|
|
81
|
+
const firstRow = await table.$('tr:nth-child(3)');
|
|
82
|
+
|
|
83
|
+
const nameTd = await firstRow.$('td:nth-child(1)');
|
|
84
|
+
const nameSpan = await nameTd.$('span.code');
|
|
85
|
+
const nameText = await nameSpan.getText();
|
|
86
|
+
|
|
87
|
+
const descriptionTd = await firstRow.$('td:nth-child(2)');
|
|
88
|
+
const descriptionText = await descriptionTd.getText();
|
|
89
|
+
|
|
90
|
+
expect(nameText).toBe('icon-position');
|
|
91
|
+
expect(descriptionText).toBeDefined();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('should validate Design tab content', async () => {
|
|
95
|
+
const tabs = await page.waitForTabsLoad();
|
|
96
|
+
|
|
97
|
+
await tabs[0].click();
|
|
98
|
+
|
|
99
|
+
await page.waitForLwcGuidePageLoad();
|
|
100
|
+
|
|
101
|
+
const designContent = await $('doc-lwc-content-layout');
|
|
102
|
+
expect(await designContent.isExisting()).toBeTruthy();
|
|
103
|
+
|
|
104
|
+
const designText = await designContent.getText();
|
|
105
|
+
expect(designText).toBeDefined();
|
|
106
|
+
expect(designText.length).toBeGreaterThan(0);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('should validate LWC accordion component specification tables', async () => {
|
|
110
|
+
await page.open('docs/lightning-design-system/guide/accordion.html');
|
|
111
|
+
await page.waitForLwcGuidePageLoad();
|
|
112
|
+
|
|
113
|
+
const tabs = await page.waitForTabsLoad();
|
|
114
|
+
await tabs[2].click();
|
|
115
|
+
|
|
116
|
+
const specContent = await page.waitForSpecificationContent();
|
|
117
|
+
|
|
118
|
+
const specPropertiesDiv = await specContent.shadow$('.specification-properties');
|
|
119
|
+
expect(await specPropertiesDiv.isExisting()).toBeTruthy();
|
|
120
|
+
|
|
121
|
+
await page.waitForSpinnerToDisappear(specPropertiesDiv);
|
|
122
|
+
|
|
123
|
+
const attributesHeading = await specPropertiesDiv.$('doc-heading');
|
|
124
|
+
const slotsHeading = await specPropertiesDiv.$$('doc-heading');
|
|
125
|
+
|
|
126
|
+
const attributesHeadingText = await attributesHeading.getText();
|
|
127
|
+
const slotsHeadingText = await slotsHeading[1].getText();
|
|
128
|
+
|
|
129
|
+
expect(attributesHeadingText.trim()).toContain('Attributes');
|
|
130
|
+
expect(slotsHeadingText.trim()).toContain('Slots');
|
|
131
|
+
|
|
132
|
+
const tables = await specPropertiesDiv.$$('table');
|
|
133
|
+
expect(tables.length).toBeGreaterThanOrEqual(2);
|
|
134
|
+
|
|
135
|
+
for (let i = 0; i < Math.min(tables.length, 2); i++) {
|
|
136
|
+
const table = tables[i];
|
|
137
|
+
const rows = await table.$$('tr');
|
|
138
|
+
expect(rows.length).toBeGreaterThan(1);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('should display Right Navigation Bar (RNB) with content', async () => {
|
|
143
|
+
await page.waitForLwcGuidePageLoad();
|
|
144
|
+
|
|
145
|
+
const sidebarContent = await (
|
|
146
|
+
await $('doc-lwc-content-layout')
|
|
147
|
+
).shadow$('div > dx-sidebar-old');
|
|
148
|
+
const sidebarTrees = await sidebarContent.shadow$$(
|
|
149
|
+
'div.container div.sidebar-content dx-tree',
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const getItemText = async (item: WebdriverIO.Element) => {
|
|
153
|
+
const link = await item.shadow$('a');
|
|
154
|
+
const tiles = await link.$$('dx-tree-tile');
|
|
155
|
+
const tileLink = await tiles[0].shadow$('a.tile.sidebar-item');
|
|
156
|
+
const label = await tileLink.$('span.tile-label');
|
|
157
|
+
return (await label.getText()).trim();
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const firstItem = (await sidebarTrees[0].shadow$$('dx-tree-item'))[0];
|
|
161
|
+
const firstChildItem = (await firstItem.shadow$$('dx-tree-item'))[0];
|
|
162
|
+
const firstChildText = await getItemText(firstChildItem);
|
|
163
|
+
|
|
164
|
+
expect(firstChildText).toBe('Accordion');
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
describe('Aura Component Specifications', () => {
|
|
169
|
+
beforeEach(async () => {
|
|
170
|
+
await page.open('docs/lightning-design-system/guide/aura-accordion.html');
|
|
171
|
+
await page.waitForLwcGuidePageLoad();
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('should validate Aura accordion component specification attributes', async () => {
|
|
175
|
+
const tabs = await page.waitForTabsLoad();
|
|
176
|
+
await tabs[2].click();
|
|
177
|
+
|
|
178
|
+
const specContent = await page.waitForSpecificationContent();
|
|
179
|
+
expect(await specContent.isExisting()).toBeTruthy();
|
|
180
|
+
|
|
181
|
+
const componentAttr = await specContent.getAttribute('component');
|
|
182
|
+
expect(componentAttr).toBe('accordion');
|
|
183
|
+
|
|
184
|
+
const modelAttr = await specContent.getAttribute('model');
|
|
185
|
+
expect(modelAttr).toBe('aura');
|
|
186
|
+
|
|
187
|
+
const namespaceAttr = await specContent.getAttribute('namespace');
|
|
188
|
+
expect(namespaceAttr).toBe('lightning');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('should validate Aura accordion component specification functionality', async () => {
|
|
192
|
+
const tabs = await page.waitForTabsLoad();
|
|
193
|
+
await tabs[2].click();
|
|
194
|
+
|
|
195
|
+
const specContent = await page.waitForSpecificationContent();
|
|
196
|
+
|
|
197
|
+
const specPropertiesDiv = await specContent.shadow$('.specification-properties');
|
|
198
|
+
|
|
199
|
+
await page.waitForSpinnerToDisappear(specPropertiesDiv);
|
|
200
|
+
|
|
201
|
+
const tables = await specPropertiesDiv.$$('table');
|
|
202
|
+
expect(tables.length).toBe(1);
|
|
203
|
+
|
|
204
|
+
const docHeadings = await specPropertiesDiv.$$('doc-heading');
|
|
205
|
+
expect(docHeadings.length).toBeGreaterThan(0);
|
|
206
|
+
|
|
207
|
+
const headingTexts = await Promise.all(
|
|
208
|
+
docHeadings.map(async (heading: WebdriverIO.Element) =>
|
|
209
|
+
(await heading.getText()).trim(),
|
|
210
|
+
),
|
|
211
|
+
);
|
|
212
|
+
expect(headingTexts).toContain('Attributes');
|
|
213
|
+
|
|
214
|
+
const table = tables[0];
|
|
215
|
+
const firstRow = await table.$('tr:nth-child(3)');
|
|
216
|
+
|
|
217
|
+
const nameTd = await firstRow.$('td:nth-child(1)');
|
|
218
|
+
const nameSpan = await nameTd.$('span.code');
|
|
219
|
+
const nameText = await nameSpan.getText();
|
|
220
|
+
|
|
221
|
+
const descriptionTd = await firstRow.$('td:nth-child(2)');
|
|
222
|
+
const descriptionText = await descriptionTd.getText();
|
|
223
|
+
|
|
224
|
+
expect(nameText).toBeDefined();
|
|
225
|
+
expect(descriptionText).toBeDefined();
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('should validate force - canvasApp component specification', async () => {
|
|
229
|
+
await page.open('docs/lightning-design-system/guide/canvasApp.html');
|
|
230
|
+
await page.waitForLwcGuidePageLoad();
|
|
231
|
+
|
|
232
|
+
const tabs = await page.waitForTabsLoad();
|
|
233
|
+
await tabs[2].click();
|
|
234
|
+
|
|
235
|
+
const specContent = await page.waitForSpecificationContent();
|
|
236
|
+
|
|
237
|
+
const specPropertiesDiv = await specContent.shadow$('.specification-properties');
|
|
238
|
+
await page.waitForSpinnerToDisappear(specPropertiesDiv);
|
|
239
|
+
|
|
240
|
+
const tables = await specPropertiesDiv.$$('table');
|
|
241
|
+
expect(tables.length).toBe(1);
|
|
242
|
+
|
|
243
|
+
const table = tables[0];
|
|
244
|
+
const firstRow = await table.$('tr:nth-child(3)');
|
|
245
|
+
|
|
246
|
+
const nameTd = await firstRow.$('td:nth-child(1)');
|
|
247
|
+
const nameSpan = await nameTd.$('span.code');
|
|
248
|
+
const nameText = await nameSpan.getText();
|
|
249
|
+
|
|
250
|
+
const descriptionTd = await firstRow.$('td:nth-child(2)');
|
|
251
|
+
const descriptionText = await descriptionTd.getText();
|
|
252
|
+
|
|
253
|
+
expect(nameText).toBeDefined();
|
|
254
|
+
expect(descriptionText).toBeDefined();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('should display Right Navigation Bar (RNB) with content', async () => {
|
|
258
|
+
await page.waitForLwcGuidePageLoad();
|
|
259
|
+
|
|
260
|
+
const sidebarContent = await (
|
|
261
|
+
await $('doc-lwc-content-layout')
|
|
262
|
+
).shadow$('div > dx-sidebar-old');
|
|
263
|
+
const sidebarTrees = await sidebarContent.shadow$$(
|
|
264
|
+
'div.container div.sidebar-content dx-tree',
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const getItemText = async (item: WebdriverIO.Element) => {
|
|
268
|
+
const link = await item.shadow$('a');
|
|
269
|
+
const tiles = await link.$$('dx-tree-tile');
|
|
270
|
+
const tileLink = await tiles[0].shadow$('a.tile.sidebar-item');
|
|
271
|
+
const label = await tileLink.$('span.tile-label');
|
|
272
|
+
return (await label.getText()).trim();
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
const auraItem = (await sidebarTrees[1].shadow$$('dx-tree-item'))[0];
|
|
276
|
+
const lightningItem = (await auraItem.shadow$$('dx-tree-item'))[0];
|
|
277
|
+
const componentsItem = (await lightningItem.shadow$$('dx-tree-item'))[0];
|
|
278
|
+
const firstComponentText = await getItemText(
|
|
279
|
+
(
|
|
280
|
+
await componentsItem.shadow$$('dx-tree-item')
|
|
281
|
+
)[0],
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
expect(firstComponentText).toBe('Accordion');
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import HomePage from '../pageobjects/home.page';
|
|
2
|
+
import DocsContentLayout from '../../shared/pageobjects/docs-content-layout';
|
|
3
|
+
|
|
4
|
+
describe('Guides and References ', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await HomePage.open();
|
|
7
|
+
});
|
|
8
|
+
it('Test if all guides are opening and check the Guide title is same as Guide button text', async () => {
|
|
9
|
+
const projectCards = await HomePage.projectCardsWithGuides;
|
|
10
|
+
|
|
11
|
+
projectCards.forEach(async (cardElem, index) => {
|
|
12
|
+
if (index === 1) {
|
|
13
|
+
const guideButton = await cardElem.$('dx-button[href*=guide]');
|
|
14
|
+
await guideButton.click();
|
|
15
|
+
await DocsContentLayout.waitForContentLayoutSidebar();
|
|
16
|
+
const heading = await DocsContentLayout.getSidebarHeading();
|
|
17
|
+
expect(heading).toBe('Guides');
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('Test If all references are clickable and check five endpoints URLs with the URLs in Api Description', async () => {
|
|
23
|
+
const projectCards = await HomePage.projectCardsWithReferences;
|
|
24
|
+
|
|
25
|
+
projectCards.forEach(async (cardElem) => {
|
|
26
|
+
const refButton = await cardElem.$('dx-button[href*=references]');
|
|
27
|
+
await refButton.click();
|
|
28
|
+
(await $('doc-amf-reference')).waitForDisplayed();
|
|
29
|
+
const shadowAmfComponent = await (
|
|
30
|
+
await $('doc-amf-reference')
|
|
31
|
+
).shadow$('div.container');
|
|
32
|
+
const sidebar = await shadowAmfComponent.$('dx-sidebar');
|
|
33
|
+
const sidebarTree = await sidebar.shadow$('dx-tree');
|
|
34
|
+
const sidebarTreeItems = await sidebarTree.shadow$$('dx-tree-item');
|
|
35
|
+
|
|
36
|
+
const endPointsNodes = await sidebarTreeItems[0].shadow$$('dx-tree-item');
|
|
37
|
+
const endPointsNode = endPointsNodes[1];
|
|
38
|
+
|
|
39
|
+
const endpointsText = (await endPointsNode.shadow$('a')).getText();
|
|
40
|
+
|
|
41
|
+
expect(endpointsText).toBe('Endpoints');
|
|
42
|
+
|
|
43
|
+
browser.back();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import HomePage from '../pageobjects/home.page';
|
|
2
|
+
// import { assertAccessibleSync } from '@sa11y/wdio';
|
|
3
|
+
|
|
4
|
+
describe('Homepage', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await HomePage.open();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('should have the right title', () => {
|
|
10
|
+
expect(browser).toHaveTitle('Salesforce Developers');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should show the expected number of projects', async () => {
|
|
14
|
+
const projectCards = await HomePage.projectCards;
|
|
15
|
+
|
|
16
|
+
expect(projectCards.length).toEqual(17);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
// it('is accessible', () => {
|
|
20
|
+
// assertAccessibleSync();
|
|
21
|
+
// });
|
|
22
|
+
|
|
23
|
+
describe('Check homepage Overview links', () => {
|
|
24
|
+
it('Test Overview button in the card', async () => {
|
|
25
|
+
const projectCards = await HomePage.projectCards;
|
|
26
|
+
const cardElem = projectCards[0];
|
|
27
|
+
const overviewButton = await cardElem.$('dx-button[href*=overview]');
|
|
28
|
+
|
|
29
|
+
expect(await overviewButton.getText()).toMatch('Overview');
|
|
30
|
+
expect(await overviewButton.isClickable()).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('Check homepage Guide links', () => {
|
|
35
|
+
it('Test Guide buttons in the cards', async () => {
|
|
36
|
+
const projectCards = await HomePage.projectCardsWithGuides;
|
|
37
|
+
|
|
38
|
+
projectCards.forEach(async (cardElem, index) => {
|
|
39
|
+
const guideButton = await cardElem.$('dx-button[href*=guide]');
|
|
40
|
+
if (index === 0 || index === 1) {
|
|
41
|
+
expect(await guideButton.getText()).not.toBe(null);
|
|
42
|
+
expect(await guideButton.isClickable()).toBeTruthy();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Page from '../../shared/pageobjects/page';
|
|
2
|
+
|
|
3
|
+
describe('/docs Media Mapper > ', () => {
|
|
4
|
+
it('should not show images with the cdn image when cdn image mapping is not enabled', async () => {
|
|
5
|
+
const page = new Page();
|
|
6
|
+
page.open('docs/plugin-development/guide/markdown-cheatsheet.html');
|
|
7
|
+
await page.waitForGuidePageLoad();
|
|
8
|
+
|
|
9
|
+
const srcValue = await $(`[alt="SalesforceDocs"]`).getAttribute('src');
|
|
10
|
+
const isLocalImagePath = srcValue.startsWith('/');
|
|
11
|
+
const isCDNMappedImagePath = srcValue.startsWith(
|
|
12
|
+
'https://a.sfdcstatic.com/developer-website/sfdocs/',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(isLocalImagePath).toBe(true);
|
|
16
|
+
expect(isCDNMappedImagePath).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import HomePage from '../pageobjects/home.page';
|
|
2
|
+
|
|
3
|
+
describe('Navigation header test', () => {
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
await HomePage.open();
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('should check for links in navigation header in Overview', async () => {
|
|
9
|
+
const projectCards = await HomePage.projectCards;
|
|
10
|
+
|
|
11
|
+
const cardElem = projectCards[0];
|
|
12
|
+
const overviewButton = await cardElem.$('dx-button[href*=overview]');
|
|
13
|
+
|
|
14
|
+
await overviewButton.click();
|
|
15
|
+
(await $('>>> .header_l2_group-nav_overflow')).waitForDisplayed();
|
|
16
|
+
|
|
17
|
+
const docHeaderNav = await $('>>> .header_l2_group-nav_overflow');
|
|
18
|
+
const headerNav = await docHeaderNav.$('>>> dx-header-nav');
|
|
19
|
+
const navTabs = await headerNav.shadow$$('dx-tab');
|
|
20
|
+
|
|
21
|
+
expect(navTabs.length).toBe(3);
|
|
22
|
+
|
|
23
|
+
const overviewNav = await navTabs[0].shadow$('a > span');
|
|
24
|
+
const guideNav = await navTabs[1].shadow$('a > span');
|
|
25
|
+
const referenceNav = await navTabs[2].shadow$('a > span');
|
|
26
|
+
|
|
27
|
+
expect(await guideNav.getText()).toBe('Guides');
|
|
28
|
+
expect(await overviewNav.getText()).toBe('Overview');
|
|
29
|
+
expect(await referenceNav.getText()).toBe('Reference');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should check for links in navigation header in Guides', async () => {
|
|
33
|
+
const projectCards = await HomePage.projectCards;
|
|
34
|
+
|
|
35
|
+
const cardElem = projectCards[0];
|
|
36
|
+
const guideButton = await cardElem.$('dx-button[href*=guide]');
|
|
37
|
+
|
|
38
|
+
await guideButton.click();
|
|
39
|
+
(await $('>>> .header_l2_group-nav_overflow')).waitForDisplayed();
|
|
40
|
+
|
|
41
|
+
const docHeaderNav = await $('>>> .header_l2_group-nav_overflow');
|
|
42
|
+
const headerNav = await docHeaderNav.$('>>> dx-header-nav');
|
|
43
|
+
const navTabs = await headerNav.shadow$$('dx-tab');
|
|
44
|
+
|
|
45
|
+
expect(navTabs.length).toBe(3);
|
|
46
|
+
|
|
47
|
+
const overviewNav = await navTabs[0].shadow$('a > span');
|
|
48
|
+
const guideNav = await navTabs[1].shadow$('a > span');
|
|
49
|
+
const referenceNav = await navTabs[2].shadow$('a > span');
|
|
50
|
+
|
|
51
|
+
expect(await overviewNav.getText()).toBe('Overview');
|
|
52
|
+
expect(await guideNav.getText()).toBe('Guides');
|
|
53
|
+
expect(await referenceNav.getText()).toBe('Reference');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should check for links in navigation header in Reference', async () => {
|
|
57
|
+
const projectCards = await HomePage.projectCards;
|
|
58
|
+
|
|
59
|
+
const cardElem = projectCards[0];
|
|
60
|
+
const guideButton = await cardElem.$('dx-button[href*=references]');
|
|
61
|
+
|
|
62
|
+
await guideButton.click();
|
|
63
|
+
(await $('>>> .header_l2_group-nav_overflow')).waitForDisplayed();
|
|
64
|
+
|
|
65
|
+
const docHeaderNav = await $('>>> .header_l2_group-nav_overflow');
|
|
66
|
+
const headerNav = await docHeaderNav.$('>>> dx-header-nav');
|
|
67
|
+
const navTabs = await headerNav.shadow$$('dx-tab');
|
|
68
|
+
|
|
69
|
+
expect(navTabs.length).toBe(3);
|
|
70
|
+
|
|
71
|
+
const overviewNav = await navTabs[0].shadow$('a > span');
|
|
72
|
+
const guideNav = await navTabs[1].shadow$('a > span');
|
|
73
|
+
const referenceNav = await navTabs[2].shadow$('a > span');
|
|
74
|
+
|
|
75
|
+
expect(await overviewNav.getText()).toBe('Overview');
|
|
76
|
+
expect(await guideNav.getText()).toBe('Guides');
|
|
77
|
+
expect(await referenceNav.getText()).toBe('Reference');
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import HomePage from '../pageobjects/home.page';
|
|
2
|
+
|
|
3
|
+
import got from 'got';
|
|
4
|
+
|
|
5
|
+
describe('Test Sitemap Routes', () => {
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
await browser.addCommand('getSitemap', async (url: any) => {
|
|
8
|
+
const data = await got(url);
|
|
9
|
+
return data;
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('Read sitemap.xml', async () => {
|
|
14
|
+
await HomePage.open('sitemap.xml');
|
|
15
|
+
const data = await browser.getSitemap('http://localhost:3000/sitemap.xml');
|
|
16
|
+
expect(data.body).toContain('sitemap-1.xml');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('Read Sitemap-contents-internal.xml', async () => {
|
|
20
|
+
await HomePage.open('sitemap.xml');
|
|
21
|
+
const data = await browser.getSitemap(
|
|
22
|
+
'http://localhost:3000/internal-sitemap-contents.xml',
|
|
23
|
+
);
|
|
24
|
+
expect(data.body).toContain('internal-sitemap-contents-1.xml');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('Read Sitemap-contents-internal-1.xml', async () => {
|
|
28
|
+
await HomePage.open('sitemap.xml');
|
|
29
|
+
const data = await browser.getSitemap(
|
|
30
|
+
'http://localhost:3000/internal-sitemap-contents-1.xml',
|
|
31
|
+
);
|
|
32
|
+
expect(data.body).toContain(
|
|
33
|
+
'/docs/commerce/test-cc-orders-api/guide/commerce-cloud-api-overview.html',
|
|
34
|
+
);
|
|
35
|
+
expect(data.body).toContain(
|
|
36
|
+
'/docs/commerce/test-cc-orders-api/guide/authentication-authorization.html',
|
|
37
|
+
);
|
|
38
|
+
expect(data.body).toContain(
|
|
39
|
+
'/docs/commerce/test-cc-orders-api/guide/explore-additional-resources.html',
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('Read Coveo sitemap.xml', async () => {
|
|
44
|
+
await browser.addCommand('getCoveoSitemap', async (url: any) => {
|
|
45
|
+
const data = await got(url, {
|
|
46
|
+
headers: {
|
|
47
|
+
'User-Agent': 'Googlebot',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return data;
|
|
51
|
+
});
|
|
52
|
+
await HomePage.open('coveo-sitemap.xml');
|
|
53
|
+
const data = await browser.getCoveoSitemap(
|
|
54
|
+
'http://localhost:3000/coveo-sitemap-doc-framework.xml',
|
|
55
|
+
);
|
|
56
|
+
expect(data.body).toContain('/coveo-sitemap-doc-framework-1.xml');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import Page from '../../shared/pageobjects/page';
|
|
2
|
+
let page: Page;
|
|
3
|
+
|
|
4
|
+
const getQueryParam = async (param: string): Promise<any> => {
|
|
5
|
+
const searchParams = new URLSearchParams(new URL(await browser.getUrl()).search);
|
|
6
|
+
const paramValue = searchParams.get(param);
|
|
7
|
+
|
|
8
|
+
return paramValue;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getActiveTabLabel = async (): Promise<any> => {
|
|
12
|
+
const activeTab = await $('>>>button.tab-active');
|
|
13
|
+
const activeTabTitle = await activeTab.getText();
|
|
14
|
+
|
|
15
|
+
return activeTabTitle;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('Tabset Plugin Scenarios ', () => {
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
page = new Page();
|
|
21
|
+
page.open('docs/lightning-design-system/guide/button.html');
|
|
22
|
+
|
|
23
|
+
await page.waitForLwcGuidePageLoad();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Tabset plugin should render tabs and its content', async () => {
|
|
27
|
+
const tabsetContent = await $('>>>dx-tab-panel-list.docs-tab');
|
|
28
|
+
expect(tabsetContent.isExisting()).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('First tab should be active by default', async () => {
|
|
32
|
+
const activeTabTitle = await getActiveTabLabel();
|
|
33
|
+
|
|
34
|
+
expect(activeTabTitle).toEqual('Design');
|
|
35
|
+
await browser.waitUntil(
|
|
36
|
+
async function () {
|
|
37
|
+
return (await getQueryParam('type')) === 'Design';
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
timeout: 5000,
|
|
41
|
+
timeoutMsg: 'Expecting query param to be `Design` value',
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('First tab content should be visible', async () => {
|
|
47
|
+
const firstTabContent = await $('>>>div.tabpanel-active');
|
|
48
|
+
expect(firstTabContent.isExisting()).toBeTruthy();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Should switch to the second tab when clicked', async () => {
|
|
52
|
+
const allTabs = await $$('>>>dx-tab-panel-item');
|
|
53
|
+
await allTabs[1].click();
|
|
54
|
+
await page.waitForLwcGuidePageLoad();
|
|
55
|
+
|
|
56
|
+
const activeTabTitle = await getActiveTabLabel();
|
|
57
|
+
|
|
58
|
+
expect(activeTabTitle).toEqual('Develop');
|
|
59
|
+
await browser.waitUntil(
|
|
60
|
+
async function () {
|
|
61
|
+
return (await getQueryParam('type')) === 'Develop';
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
timeout: 5000,
|
|
65
|
+
timeoutMsg: 'Expecting query param to be `Develop` value',
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('Check the URL has correct active tab as param', async () => {
|
|
71
|
+
await browser.waitUntil(
|
|
72
|
+
async function () {
|
|
73
|
+
return (await getQueryParam('type')) === 'Design';
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
timeout: 5000,
|
|
77
|
+
timeoutMsg: 'Expecting query param to be `Design` value',
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|