@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,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared base page object for content-repo and portal.
|
|
3
|
+
* Supports both usage patterns: constructor(path) + open() or open(path).
|
|
4
|
+
*/
|
|
5
|
+
export default class Page {
|
|
6
|
+
REFERENCE_LOAD_WAIT_TIME = 50000;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Path to the page we're testing (used when open() is called without args).
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
|
|
13
|
+
constructor(path = '') {
|
|
14
|
+
this.path = path;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Opens a page. If path is provided, navigates to /path; otherwise uses this.path.
|
|
19
|
+
*/
|
|
20
|
+
open(path?: string): void {
|
|
21
|
+
const target = path !== undefined && path !== null ? `/${path}` : this.path || '/';
|
|
22
|
+
browser.url(target);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get projectCards(): Promise<WebdriverIO.ElementArray> {
|
|
26
|
+
return $('dx-section.api-landing-section_list')
|
|
27
|
+
.then((section) => section.$('dx-grid'))
|
|
28
|
+
.then((grid) => grid.$$('dx-card-docs'));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get projectCardsWithGuides(): Promise<WebdriverIO.ElementArray | WebdriverIO.Element[]> {
|
|
32
|
+
return this.projectCards.then((cards: WebdriverIO.ElementArray) => {
|
|
33
|
+
return cards.filter((card: WebdriverIO.Element) => {
|
|
34
|
+
return card.$('dx-button[href*=guide]').then((guideLink) => guideLink.isExisting());
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get projectCardsWithReferences(): Promise<WebdriverIO.ElementArray | WebdriverIO.Element[]> {
|
|
40
|
+
return this.projectCards.then((cards) =>
|
|
41
|
+
cards.filter((card) =>
|
|
42
|
+
card.$('dx-button[href*=references]').then((link) => link.isExisting()),
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async getHeader(): Promise<WebdriverIO.Element> {
|
|
48
|
+
return await $('hgf-c360contextnav');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async getHeaderTitle(): Promise<WebdriverIO.Element> {
|
|
52
|
+
return (await $('>>>header')).$('h4');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getGlobalSearchBox(headerTag = 'dx-header'): Promise<WebdriverIO.Element> {
|
|
56
|
+
return (await $(headerTag)).shadow$('dx-header-search');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async getBreadCrumbs(): Promise<WebdriverIO.Element> {
|
|
60
|
+
return $('>>>doc-breadcrumbs');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async getActiveNavTab(): Promise<WebdriverIO.Element> {
|
|
64
|
+
return $('>>>a.nav-list-item_default.state-active');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async getFooter(): Promise<WebdriverIO.Element> {
|
|
68
|
+
return await $('>>>dx-footer');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async waitForReferencePageLoad(): Promise<void> {
|
|
72
|
+
await (
|
|
73
|
+
await $('>>>.api-documentation')
|
|
74
|
+
).waitForDisplayed({ timeout: this.REFERENCE_LOAD_WAIT_TIME });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async waitForGuidePageLoad(): Promise<void> {
|
|
78
|
+
await $('doc-content-layout').waitForDisplayed({ timeout: 5000 });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async waitForLwcGuidePageLoad(): Promise<void> {
|
|
82
|
+
await $('doc-lwc-content-layout').waitForDisplayed({ timeout: 5000 });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async waitForTabsLoad(): Promise<WebdriverIO.ElementArray> {
|
|
86
|
+
return await $$('>>>dx-tab-panel-item');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async waitForSpecificationContent(): Promise<WebdriverIO.Element> {
|
|
90
|
+
await browser.waitUntil(
|
|
91
|
+
async function () {
|
|
92
|
+
const specContent = await $('>>>doc-specification-content');
|
|
93
|
+
return await specContent.isExisting();
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
timeout: 15000,
|
|
97
|
+
timeoutMsg: 'Expected doc-specification-content to be present',
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
return await $('>>>doc-specification-content');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async waitForSpinnerToDisappear(element: WebdriverIO.Element): Promise<void> {
|
|
104
|
+
await browser.waitUntil(
|
|
105
|
+
async function () {
|
|
106
|
+
const spinner = await element.$('dx-spinner');
|
|
107
|
+
return !(await spinner.isExisting());
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
timeout: 15000,
|
|
111
|
+
timeoutMsg: 'Specification content did not load within timeout',
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Page from './page';
|
|
2
|
+
|
|
3
|
+
export class ReferencePage extends Page {
|
|
4
|
+
async getVersionPickerBtn(): Promise<WebdriverIO.Element> {
|
|
5
|
+
const versionPicker = await $('>>>.version-picker-button');
|
|
6
|
+
await versionPicker.waitForDisplayed();
|
|
7
|
+
await versionPicker.waitForClickable();
|
|
8
|
+
return versionPicker;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getApiTitle(): Promise<WebdriverIO.Element> {
|
|
12
|
+
return $('>>>div.api-title');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async waitForSpecBasedReferencePageLoad(): Promise<void> {
|
|
16
|
+
await (
|
|
17
|
+
await $('>>>.api-documentation')
|
|
18
|
+
).waitForDisplayed({ timeout: this.REFERENCE_LOAD_WAIT_TIME });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async waitForMarkdownBasedReferencePageLoad(): Promise<void> {
|
|
22
|
+
await (
|
|
23
|
+
await $('>>>doc-content-layout')
|
|
24
|
+
).waitForDisplayed({ timeout: this.REFERENCE_LOAD_WAIT_TIME });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async selectVersion(): Promise<void> {
|
|
28
|
+
const versionPicker = await this.getVersionPickerBtn();
|
|
29
|
+
await versionPicker.click();
|
|
30
|
+
const versionOptions = await $$('>>>doc-version-picker dx-dropdown-option');
|
|
31
|
+
await versionOptions[1].click();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
openPage(path: string): void {
|
|
35
|
+
browser.url(path);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async getSidebarContent(): Promise<WebdriverIO.Element> {
|
|
39
|
+
return $('>>>div .sidebar-item-selected');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import GuidePage from '../pageobjects/guide.page';
|
|
2
|
+
|
|
3
|
+
describe('Anchor Heading Plugin Scenarios(doc-heading)', () => {
|
|
4
|
+
beforeEach(async () => {
|
|
5
|
+
const page = new GuidePage('/docs/commerce/test-cc-orders-api/guide/quick-start.html');
|
|
6
|
+
page.open();
|
|
7
|
+
await page.waitPageLoad();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('doc-heading component is rendering', async () => {
|
|
11
|
+
const docheadingDescriptionList = await $$('>>>doc-heading')[0];
|
|
12
|
+
const docheadingVideo = await $$('>>>doc-heading')[1];
|
|
13
|
+
const docheadingSeeAlso = await $$('>>>doc-heading')[2];
|
|
14
|
+
|
|
15
|
+
expect(await docheadingDescriptionList?.getAttribute('hash')).toEqual(
|
|
16
|
+
'explore-the-sample-app',
|
|
17
|
+
);
|
|
18
|
+
expect(await docheadingVideo?.getAttribute('hash')).toEqual('join-the-beta-program');
|
|
19
|
+
expect(await docheadingSeeAlso?.getAttribute('hash')).toEqual('see-also');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import Page from '../pageobjects/page';
|
|
2
|
+
|
|
3
|
+
const assertBannerMarkup = async (headerElement: WebdriverIO.Element): Promise<void> => {
|
|
4
|
+
const bannerContent = await headerElement.$('>>>div.info-container span');
|
|
5
|
+
const text = await bannerContent.getText();
|
|
6
|
+
|
|
7
|
+
// Portal shows "about our example portal"; preview shows "about our example repository"
|
|
8
|
+
const hasExpectedBanner =
|
|
9
|
+
text.includes('about our example portal') || text.includes('about our example repository');
|
|
10
|
+
expect(hasExpectedBanner).toBe(true);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const assertSignupIsHidden = async (headerElement: WebdriverIO.Element): Promise<void> => {
|
|
14
|
+
const signupElement = await headerElement.$('>>>.header-login-signup');
|
|
15
|
+
const isExisting = await signupElement.isExisting();
|
|
16
|
+
|
|
17
|
+
expect(isExisting).toBe(true);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const navigateWithPathAndAssertDxHeader = async (path: string): Promise<void> => {
|
|
21
|
+
const page = new Page(path);
|
|
22
|
+
page.open();
|
|
23
|
+
|
|
24
|
+
await $('dx-header').waitForDisplayed({ timeout: 10000 });
|
|
25
|
+
const headerElement = await $('dx-header');
|
|
26
|
+
|
|
27
|
+
await assertBannerMarkup(headerElement);
|
|
28
|
+
await assertSignupIsHidden(headerElement);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const navigateWithPathAndAssertDocHeader = async (path: string): Promise<void> => {
|
|
32
|
+
const page = new Page(path);
|
|
33
|
+
page.open();
|
|
34
|
+
|
|
35
|
+
await $('doc-header').waitForDisplayed({ timeout: 10000 });
|
|
36
|
+
const headerElement = await $('doc-header');
|
|
37
|
+
|
|
38
|
+
await assertBannerMarkup(headerElement);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
describe('Banner Portal Tests', () => {
|
|
42
|
+
// Banner will not be appearing in the home page with global nav changes so skipping the test for now
|
|
43
|
+
it.skip('should show configured banner text and signup button in the home page', async () => {
|
|
44
|
+
await navigateWithPathAndAssertDxHeader('/');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it.skip('should show configured banner text and signup button in the docs page', async () => {
|
|
48
|
+
await navigateWithPathAndAssertDxHeader('/docs');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it.skip('should show configured banner text and signup button in the apis page', async () => {
|
|
52
|
+
await navigateWithPathAndAssertDxHeader('/docs/apis');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should show configured banner text and signup button in the sfdocs Overview page', async () => {
|
|
56
|
+
await navigateWithPathAndAssertDocHeader('/docs/success/sfdocs/overview');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should show configured banner text and signup button in the sfdocs guide page', async () => {
|
|
60
|
+
await navigateWithPathAndAssertDocHeader('/docs/success/sfdocs/guide');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should show configured banner text and signup button in the sfdocs reference page', async () => {
|
|
64
|
+
await navigateWithPathAndAssertDocHeader('/docs/success/sfdocs/references');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Page from '../pageobjects/page';
|
|
2
|
+
|
|
3
|
+
let page: Page;
|
|
4
|
+
|
|
5
|
+
describe('Breadcrumbs in Guides and Reference', () => {
|
|
6
|
+
it('should check for breadcrumbs in Guides', async () => {
|
|
7
|
+
page = new Page('/docs/commerce/test-cc-orders-api/guide/find-sfra-tools.html');
|
|
8
|
+
page.open();
|
|
9
|
+
|
|
10
|
+
const contentBody = await $('>>> div.content-body');
|
|
11
|
+
|
|
12
|
+
await contentBody.waitForDisplayed();
|
|
13
|
+
|
|
14
|
+
const anchorBreadcrumb = await $('>>>doc-breadcrumbs doc-breadcrumb-item a');
|
|
15
|
+
|
|
16
|
+
expect(anchorBreadcrumb).not.toBeNull();
|
|
17
|
+
expect(await anchorBreadcrumb.getText()).toBe('Get Started');
|
|
18
|
+
|
|
19
|
+
const currentPageBreadcrumb = await $('>>>doc-breadcrumbs doc-breadcrumb-item span');
|
|
20
|
+
|
|
21
|
+
expect(currentPageBreadcrumb).not.toBeNull();
|
|
22
|
+
expect(await currentPageBreadcrumb.getText()).toBe('Find SFRA Tools');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should check for breadcrumbs in Reference', async () => {
|
|
26
|
+
page = new Page(
|
|
27
|
+
'/docs/commerce/flex-references-vers/references/manual-ref/update-order-states.html',
|
|
28
|
+
);
|
|
29
|
+
page.open();
|
|
30
|
+
|
|
31
|
+
const contentBody = await $('>>> div.content-body');
|
|
32
|
+
|
|
33
|
+
await contentBody.waitForDisplayed();
|
|
34
|
+
|
|
35
|
+
const anchorBreadcrumb = await $('>>>doc-breadcrumbs doc-breadcrumb-item a');
|
|
36
|
+
|
|
37
|
+
expect(anchorBreadcrumb).not.toBeNull();
|
|
38
|
+
expect(await anchorBreadcrumb.getText()).toBe('Update Orders');
|
|
39
|
+
|
|
40
|
+
const currentPageBreadcrumb = await $('>>>doc-breadcrumbs doc-breadcrumb-item span');
|
|
41
|
+
|
|
42
|
+
expect(currentPageBreadcrumb).not.toBeNull();
|
|
43
|
+
expect(await currentPageBreadcrumb.getText()).toBe('Update Order States');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import GuidePage from '../pageobjects/guide.page';
|
|
2
|
+
import Callout from '../pageobjects/callout';
|
|
3
|
+
|
|
4
|
+
let page: GuidePage;
|
|
5
|
+
|
|
6
|
+
describe('Callout Content Tests', () => {
|
|
7
|
+
beforeEach(async () => {
|
|
8
|
+
page = new GuidePage('/docs/plugin-development/guide/callouts-plugin-usage.html');
|
|
9
|
+
page.open();
|
|
10
|
+
await page.waitPageLoad();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('Check callout should render properly', async () => {
|
|
14
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
15
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
16
|
+
expect(callouts.length).toEqual(12);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('Check callout should render "note" callout properly', async () => {
|
|
20
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
21
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
22
|
+
expect(await callouts[1].getAttribute('header')).toEqual('Note');
|
|
23
|
+
expect(await callouts[1].getAttribute('variant')).toEqual('note');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Check callout should render "Tip" callout properly', async () => {
|
|
27
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
28
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
29
|
+
expect(await callouts[0].getAttribute('header')).toEqual('Tip');
|
|
30
|
+
expect(await callouts[0].getAttribute('variant')).toEqual('tip');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('Check callout should render "Warning" callout properly', async () => {
|
|
34
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
35
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
36
|
+
expect(await callouts[2].getAttribute('header')).toEqual('Warning');
|
|
37
|
+
expect(await callouts[2].getAttribute('variant')).toEqual('warning');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('Check callout should render "Caution" callout properly', async () => {
|
|
41
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
42
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
43
|
+
expect(await callouts[3].getAttribute('header')).toEqual('Caution');
|
|
44
|
+
expect(await callouts[3].getAttribute('variant')).toEqual('caution');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('Check callout should render "Important" callout properly', async () => {
|
|
48
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
49
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
50
|
+
expect(await callouts[9].getAttribute('header')).toEqual('Important');
|
|
51
|
+
expect(await callouts[9].getAttribute('variant')).toEqual('important');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('Check callout should render "note" callout properly with paragraph and list item', async () => {
|
|
55
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
56
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
57
|
+
expect(await callouts[1].getProperty('innerHTML')).toEqual(
|
|
58
|
+
'<p>First line of tip text\nSecond line of tip text</p><ul>\n<li>List inside the blockquotes</li>\n</ul>',
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('Check callout should render "anchor link" in the callout warning properly', async () => {
|
|
63
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
64
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
65
|
+
expect(await callouts[5].getAttribute('header')).toEqual('Warning');
|
|
66
|
+
expect(await callouts[5].getAttribute('variant')).toEqual('warning');
|
|
67
|
+
expect((await callouts[5].getProperty('innerHTML')).includes('href')).toBeTruthy();
|
|
68
|
+
expect(
|
|
69
|
+
(await callouts[5].getProperty('innerHTML')).includes('salesforce.com'),
|
|
70
|
+
).toBeTruthy();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('Check callout should render "table" in the callout tip properly', async () => {
|
|
74
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
75
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
76
|
+
expect(await callouts[6].getAttribute('header')).toEqual('Tip');
|
|
77
|
+
expect(await callouts[6].getAttribute('variant')).toEqual('tip');
|
|
78
|
+
expect((await callouts[6].getProperty('innerHTML')).includes('table')).toBeTruthy();
|
|
79
|
+
expect((await callouts[6].getProperty('innerHTML')).includes('sfdocs')).toBeTruthy();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('Check callout should render "image" in the callout note properly', async () => {
|
|
83
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
84
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
85
|
+
expect(await callouts[7].getAttribute('header')).toEqual('Note');
|
|
86
|
+
expect(await callouts[7].getAttribute('variant')).toEqual('note');
|
|
87
|
+
expect((await callouts[7].getProperty('innerHTML')).includes('doc-heading')).toBeTruthy();
|
|
88
|
+
expect((await callouts[7].getProperty('innerHTML')).includes('img')).toBeTruthy();
|
|
89
|
+
expect(
|
|
90
|
+
(await callouts[7].getProperty('innerHTML')).includes('SalesforceDocs'),
|
|
91
|
+
).toBeTruthy();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('Check callout should render "table" in the callout important properly', async () => {
|
|
95
|
+
const sectionsContentLayout = await Callout.waitAndGetDocPhaseParentInGuidePage();
|
|
96
|
+
const callouts = await Callout.waitAndGetListOfCallout(sectionsContentLayout);
|
|
97
|
+
expect(await callouts[9].getAttribute('header')).toEqual('Important');
|
|
98
|
+
expect(await callouts[9].getAttribute('variant')).toEqual('important');
|
|
99
|
+
expect((await callouts[9].getProperty('innerHTML')).includes('table')).toBeTruthy();
|
|
100
|
+
expect((await callouts[9].getProperty('innerHTML')).includes('sfdocs')).toBeTruthy();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import GuidePage from '../pageobjects/guide.page';
|
|
2
|
+
|
|
3
|
+
let page: GuidePage;
|
|
4
|
+
describe('Code blocks scenarios ', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
page = new GuidePage(
|
|
7
|
+
'/docs/commerce/test-cc-orders-api/guide/change-shipping-address.html',
|
|
8
|
+
);
|
|
9
|
+
page.open();
|
|
10
|
+
await page.waitPageLoad();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('Should render the fence code block plugin', async () => {
|
|
14
|
+
const codeBlockElement = await $('>>>.code-block-content');
|
|
15
|
+
const codeElement = await codeBlockElement.shadow$('code');
|
|
16
|
+
const result = await codeElement.getText();
|
|
17
|
+
|
|
18
|
+
await expect(result.includes('stdio.h')).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('Should render the github code block plugin', async () => {
|
|
22
|
+
const customCodeBlockElement = await $$('>>>.custom-code-block')[1];
|
|
23
|
+
const codeBlock = await customCodeBlockElement?.shadow$('dx-code-block');
|
|
24
|
+
const result = await codeBlock?.getText();
|
|
25
|
+
|
|
26
|
+
await expect(result?.includes('println')).toBeTruthy();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('Should contain the title for github code block plugin', async () => {
|
|
30
|
+
const codeBlockHeading = await $$('>>>.header-text')[1];
|
|
31
|
+
const result = await codeBlockHeading?.getText();
|
|
32
|
+
|
|
33
|
+
await expect(result?.includes('From the same repo')).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('Should render the description list', async () => {
|
|
37
|
+
const descriptionListElement = await $('>>>dl');
|
|
38
|
+
const dtElement = await descriptionListElement.$('dt');
|
|
39
|
+
expect(await dtElement.getText()).toBe('First Term');
|
|
40
|
+
const ddElement = await descriptionListElement.$('dd');
|
|
41
|
+
const paraElement = await ddElement.$('p');
|
|
42
|
+
expect(await paraElement.getText()).toBe('This text describes the first term.');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Page from '../pageobjects/page';
|
|
2
|
+
|
|
3
|
+
let page: Page;
|
|
4
|
+
|
|
5
|
+
describe('DevCenter Link Tests', () => {
|
|
6
|
+
it('Check if the devCenter link is displayed for Overview Page', async () => {
|
|
7
|
+
page = new Page('/docs/commerce/test-cc-orders-api/overview');
|
|
8
|
+
page.open();
|
|
9
|
+
(await $('>>> div.content-type.content-type-overview')).waitForDisplayed({ timeout: 5000 });
|
|
10
|
+
|
|
11
|
+
const devCenterItem = await $('>>> div.dev-center-link');
|
|
12
|
+
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
13
|
+
|
|
14
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
15
|
+
'Commerce Cloud',
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('Check if the devCenter link is displayed for Guides Page', async () => {
|
|
20
|
+
page = new Page('/docs/service/vscode-maintainer/guide/vscode-quickstart.html');
|
|
21
|
+
page.open();
|
|
22
|
+
|
|
23
|
+
const devCenterItem = await $('>>> div.dev-center-link');
|
|
24
|
+
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
25
|
+
|
|
26
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
27
|
+
'Service Cloud',
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('Check if the devCenter link is displayed for References Page', async () => {
|
|
32
|
+
page = new Page('docs/commerce/test-cc-orders-api/references/Z11hRXt1?meta=Summary');
|
|
33
|
+
page.open();
|
|
34
|
+
|
|
35
|
+
const devCenterItem = await $('>>> div.dev-center-link');
|
|
36
|
+
expect(devCenterItem.isExisting()).toBeTruthy();
|
|
37
|
+
|
|
38
|
+
expect(await (await devCenterItem.$('span.subtitle.dx-text-body-4')).getText()).toEqual(
|
|
39
|
+
'Commerce Cloud',
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import Page from '../pageobjects/page';
|
|
2
|
+
import {
|
|
3
|
+
phases,
|
|
4
|
+
waitAndGetDocPhaseParentInOverviewPage,
|
|
5
|
+
waitAndGetDocPhaseParentInGuidePage,
|
|
6
|
+
waitAndGetDocPhaseParentInReferencesPage,
|
|
7
|
+
assertDocPhaseElements,
|
|
8
|
+
assertDocPhaseUnavailability,
|
|
9
|
+
} from '../pageobjects/doc-phase-config';
|
|
10
|
+
|
|
11
|
+
let page: Page;
|
|
12
|
+
|
|
13
|
+
describe('Doc Phase at Project Level Tests', () => {
|
|
14
|
+
it('should render doc-phase in overview content type with title and body', async () => {
|
|
15
|
+
page = new Page('/docs/commerce/test-cc-orders-api/overview');
|
|
16
|
+
page.open();
|
|
17
|
+
|
|
18
|
+
const section = await waitAndGetDocPhaseParentInOverviewPage();
|
|
19
|
+
|
|
20
|
+
await assertDocPhaseElements(section);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should render doc-phase in guide content type with title and body', async () => {
|
|
24
|
+
page = new Page('docs/commerce/test-cc-orders-api/guide/commerce-cloud-api-overview.html');
|
|
25
|
+
page.open();
|
|
26
|
+
|
|
27
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInGuidePage();
|
|
28
|
+
|
|
29
|
+
await assertDocPhaseElements(sectionsContentLayout);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should render doc-phase in references content type with title and body', async () => {
|
|
33
|
+
page = new Page('docs/commerce/test-cc-orders-api/references/Z11hRXt1?meta=Summary');
|
|
34
|
+
page.open();
|
|
35
|
+
|
|
36
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInReferencesPage();
|
|
37
|
+
|
|
38
|
+
await assertDocPhaseElements(sectionsContentLayout);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should not render doc-phase in overview content type in not configured project', async () => {
|
|
42
|
+
page = new Page('/docs/service/vscode-maintainer/overview');
|
|
43
|
+
page.open();
|
|
44
|
+
|
|
45
|
+
const section = await waitAndGetDocPhaseParentInOverviewPage();
|
|
46
|
+
|
|
47
|
+
await assertDocPhaseUnavailability(section);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should not render doc-phase in guide content type in not configured project', async () => {
|
|
51
|
+
page = new Page('/docs/service/vscode-maintainer/guide/vscode-overview.html');
|
|
52
|
+
page.open();
|
|
53
|
+
|
|
54
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInGuidePage();
|
|
55
|
+
|
|
56
|
+
await assertDocPhaseUnavailability(sectionsContentLayout);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('Doc Phase at Content Type Level Tests', () => {
|
|
61
|
+
it('should render beta doc-phase config in overview content type', async () => {
|
|
62
|
+
page = new Page('/docs/test-metamind-oas-api/overview');
|
|
63
|
+
page.open();
|
|
64
|
+
|
|
65
|
+
const section = await waitAndGetDocPhaseParentInOverviewPage();
|
|
66
|
+
|
|
67
|
+
await assertDocPhaseElements(section, phases.beta);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should render pilot doc-phase config in guide content type', async () => {
|
|
71
|
+
page = new Page('/docs/test-metamind-oas-api/guide/metamind-overview.html');
|
|
72
|
+
page.open();
|
|
73
|
+
|
|
74
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInGuidePage();
|
|
75
|
+
|
|
76
|
+
await assertDocPhaseElements(sectionsContentLayout, phases.pilot);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should render dev preview doc-phase config in references content type', async () => {
|
|
80
|
+
page = new Page('/docs/test-metamind-oas-api/references/1mkfx9?meta=Summary');
|
|
81
|
+
page.open();
|
|
82
|
+
|
|
83
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInReferencesPage();
|
|
84
|
+
|
|
85
|
+
await assertDocPhaseElements(sectionsContentLayout, phases.devPreview);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('Doc Phase at Reference Sources Tests', () => {
|
|
90
|
+
it('should render beta doc-phase config in v1.0.0 first reference', async () => {
|
|
91
|
+
page = new Page('/docs/test-multiple-references/references/Z1gIeJG?meta=Summary');
|
|
92
|
+
page.open();
|
|
93
|
+
|
|
94
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInReferencesPage();
|
|
95
|
+
|
|
96
|
+
await assertDocPhaseElements(sectionsContentLayout, phases.beta);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should render pilot doc-phase config in v1.0.0 second reference', async () => {
|
|
100
|
+
page = new Page('/docs/test-multiple-references/references/tLvjG?meta=Summary');
|
|
101
|
+
page.open();
|
|
102
|
+
|
|
103
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInReferencesPage();
|
|
104
|
+
|
|
105
|
+
await assertDocPhaseElements(sectionsContentLayout, phases.pilot);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should render devPreview doc-phase config in v234.0 second reference', async () => {
|
|
109
|
+
page = new Page('docs/test-multiple-references/references/Z11OT4X/234.0?meta=Summary');
|
|
110
|
+
page.open();
|
|
111
|
+
|
|
112
|
+
const sectionsContentLayout = await waitAndGetDocPhaseParentInReferencesPage();
|
|
113
|
+
|
|
114
|
+
await assertDocPhaseElements(sectionsContentLayout, phases.devPreview);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe('Release Phase at the topic level tests', () => {
|
|
119
|
+
it('should not render release phase in guide topic level given it was not configured', async () => {
|
|
120
|
+
page = new Page('/docs/redirects-url/guide/orders-api-overview.html');
|
|
121
|
+
page.open();
|
|
122
|
+
|
|
123
|
+
const sectionLayout = await waitAndGetDocPhaseParentInGuidePage();
|
|
124
|
+
|
|
125
|
+
await assertDocPhaseUnavailability(sectionLayout);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ErrorPage from '../pageobjects/error.page';
|
|
2
|
+
import layoutTest from './layout-tests';
|
|
3
|
+
|
|
4
|
+
let page: ErrorPage;
|
|
5
|
+
describe('Error > 404/5xx > ', () => {
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
page = new ErrorPage();
|
|
8
|
+
page.open();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
layoutTest(page);
|
|
12
|
+
|
|
13
|
+
it('Open Error route when the referenced URL is not available', async () => {
|
|
14
|
+
// Wait for the dx-error component to be available
|
|
15
|
+
const errorComponent = await $('dx-error');
|
|
16
|
+
await errorComponent.waitForDisplayed();
|
|
17
|
+
|
|
18
|
+
// Check the cta attribute directly
|
|
19
|
+
const ctaText = await errorComponent.getAttribute('cta');
|
|
20
|
+
|
|
21
|
+
expect(await browser.getTitle()).toEqual('404 Error | Salesforce Developers');
|
|
22
|
+
expect(ctaText).toEqual('Go Home');
|
|
23
|
+
});
|
|
24
|
+
});
|