@salesforcedevs/sfdocs-e2e 1.0.12-e2e-topic-version-1 → 1.0.12-e2e-topic-version-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/sfdocs-e2e",
3
- "version": "1.0.12-e2e-topic-version-1",
3
+ "version": "1.0.12-e2e-topic-version-2",
4
4
  "description": "E2E test suite for SFDocs static portal pages (SSG)",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -56,7 +56,9 @@ describe('Test Sitemap Routes', () => {
56
56
  );
57
57
 
58
58
  // Spec (Redoc) topics are published without an extension.
59
- expect(data.body).toContain('<loc>/docs/docs-content-type-example/sample-api</loc>');
59
+ expect(data.body).toContain(
60
+ '<loc>/docs/docs-content-type-example/widgets-api-reference</loc>',
61
+ );
60
62
  expect(data.body).toContain('<loc>/docs/docs-content-type-example/new-sample-api</loc>');
61
63
 
62
64
  // Each markdown URL appears exactly once.
@@ -88,6 +88,21 @@ export default class Page {
88
88
  return treeItem.shadow$('dx-tree-tile');
89
89
  }
90
90
 
91
+ /**
92
+ * Options render in a single shared overlay, one per picker on the page, hidden until their
93
+ * own dropdown opens — filtering to visible ones scopes this to whichever just opened.
94
+ */
95
+ async getVersionOptions(): Promise<WebdriverIO.Element[]> {
96
+ const allOptions = await $$('>>>doc-version-picker dx-dropdown-option');
97
+ const visible: WebdriverIO.Element[] = [];
98
+ for (const option of allOptions) {
99
+ if (await option.isDisplayed()) {
100
+ visible.push(option);
101
+ }
102
+ }
103
+ return visible;
104
+ }
105
+
91
106
  async waitForSpinnerToDisappear(element: WebdriverIO.Element): Promise<void> {
92
107
  await browser.waitUntil(
93
108
  async function () {
@@ -166,11 +166,6 @@ export default class TopicVersionPage extends Page {
166
166
  await trigger.click();
167
167
  }
168
168
 
169
- /** Dropdown options render in a single shared overlay, so this is a global (unscoped) query. */
170
- async getVersionOptions(): Promise<WebdriverIO.ElementArray> {
171
- return $$('>>>doc-version-picker dx-dropdown-option');
172
- }
173
-
174
169
  async getOptionLabel(option: WebdriverIO.Element): Promise<string> {
175
170
  const label = await option.shadow$('div>div');
176
171
  return (await label.getText()).trim();
@@ -85,7 +85,7 @@ describe('Docs content type', () => {
85
85
  await parentTile.click();
86
86
  await page.waitPageLoad();
87
87
 
88
- expect(await browser.getUrl()).toContain('parent-with-refs.html');
88
+ expect(await browser.getUrl()).toContain('errors-and-rate-limits.html');
89
89
  expect(await (await page.getContentHeading()).getText()).toContain(
90
90
  'Errors and Rate Limits',
91
91
  );
@@ -197,7 +197,7 @@ describe('Docs content type > internal links', () => {
197
197
 
198
198
  describe('Docs content type > spec (Redoc) topic', () => {
199
199
  beforeEach(async () => {
200
- page = new DocsPage('/docs/docs-content-type-example/sample-api');
200
+ page = new DocsPage('/docs/docs-content-type-example/widgets-api-reference');
201
201
  page.open();
202
202
  await page.waitForRedocLoad();
203
203
  });
@@ -218,7 +218,7 @@ describe('Docs content type > spec (Redoc) topic', () => {
218
218
 
219
219
  it('falls back to the landing topic when the back link is clicked on a directly opened spec', async () => {
220
220
  await browser.reloadSession();
221
- page = new DocsPage('/docs/docs-content-type-example/sample-api');
221
+ page = new DocsPage('/docs/docs-content-type-example/widgets-api-reference');
222
222
  page.open();
223
223
  await page.waitForRedocLoad();
224
224
 
@@ -245,7 +245,7 @@ describe('Docs content type > locale picker', () => {
245
245
  });
246
246
 
247
247
  it('shows the language picker on a spec topic of a localized project', async () => {
248
- page = new DocsPage('/docs/docs-content-type-example/sample-api');
248
+ page = new DocsPage('/docs/docs-content-type-example/widgets-api-reference');
249
249
  page.open();
250
250
  await page.waitForRedocLoad();
251
251
 
@@ -256,7 +256,7 @@ describe('Docs content type > locale picker', () => {
256
256
  });
257
257
 
258
258
  it('re-renders the spec in the selected locale when switching language on a spec page', async () => {
259
- page = new DocsPage('/docs/docs-content-type-example/sample-api');
259
+ page = new DocsPage('/docs/docs-content-type-example/widgets-api-reference');
260
260
  page.open();
261
261
  await page.waitForRedocLoad();
262
262
 
@@ -306,7 +306,7 @@ describe('Docs content type > localized (ja-jp) rendering', () => {
306
306
  });
307
307
 
308
308
  it('renders the Redoc view from a ja-jp spec URL', async () => {
309
- page = new DocsPage('/docs/ja-jp/docs-content-type-example/sample-api');
309
+ page = new DocsPage('/docs/ja-jp/docs-content-type-example/widgets-api-reference');
310
310
  page.open();
311
311
  await page.waitForRedocLoad();
312
312
 
@@ -106,7 +106,7 @@ describe('Reference Versioning', () => {
106
106
  const versionBtn = await $('>>>.version-picker-button');
107
107
  await versionBtn.waitForDisplayed();
108
108
  await versionBtn.click();
109
- const versionOptions = await $$('>>>doc-version-picker dx-dropdown-option');
109
+ const versionOptions = await referencePage.getVersionOptions();
110
110
 
111
111
  expect(versionOptions.length).toEqual(2);
112
112
  expect(await (await versionOptions[0].shadow$('div>div')).getText()).toEqual('0.1.3');
@@ -131,7 +131,7 @@ describe('Reference Versioning', () => {
131
131
  await versionBtn.waitForDisplayed();
132
132
  await versionBtn.click();
133
133
 
134
- const versionOptions = await $$('>>>doc-version-picker dx-dropdown-option');
134
+ const versionOptions = await referencePage.getVersionOptions();
135
135
 
136
136
  await versionOptions[1].waitForClickable();
137
137
  await versionOptions[1].click();
@@ -150,7 +150,7 @@ describe('Reference Versioning', () => {
150
150
  await versionPicker.waitForDisplayed();
151
151
  await versionPicker.click();
152
152
 
153
- const versionOptions = await $$('>>>doc-version-picker dx-dropdown-option');
153
+ const versionOptions = await referencePage.getVersionOptions();
154
154
  const selectedVersionText = await (await versionOptions[1].shadow$('div>div')).getText();
155
155
 
156
156
  await versionOptions[1].click();