Skip to content

Commit 7f9bf9c

Browse files
authored
Added VR tests to declarative chart (#104)
* added VR tests * updated snapshots * updated snapshots * removed unwanted chnages * updated snashots
1 parent 0946368 commit 7f9bf9c

File tree

89 files changed

+2365
-2102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2365
-2102
lines changed

apps/plotly_examples/package-lock.json

Lines changed: 83 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/plotly_examples/src/components/DeclarativeChart.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,21 @@ export class DeclarativeChartBasicExample extends React.Component<{}, IDeclarati
149149
>
150150
Download
151151
</button>
152-
<br />
153-
<br />
154-
<h2>{this.state.selectedChoice}. {selectedSchema.layout.title}</h2>
155-
<br />
156-
<br />
157-
<ErrorBoundary>
158-
<DeclarativeChart
159-
key={uniqueKey}
160-
chartSchema={inputSchema}
161-
onSchemaChange={this._handleChartSchemaChanged}
162-
componentRef={this._declarativeChartRef}
163-
/>
164-
</ErrorBoundary>
152+
<div data-testid="chart-container" >
153+
<br />
154+
<br />
155+
<h2>{this.state.selectedChoice}. {selectedSchema.layout.title}</h2>
156+
<br />
157+
<br />
158+
<ErrorBoundary>
159+
<DeclarativeChart
160+
key={uniqueKey}
161+
chartSchema={inputSchema}
162+
onSchemaChange={this._handleChartSchemaChanged}
163+
componentRef={this._declarativeChartRef}
164+
/>
165+
</ErrorBoundary>
166+
</div>
165167
<br />
166168
<TextField
167169
label="Current Legend selection"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"status": "failed",
3+
"failedTests": []
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
/test-results/
3+
/playwright-report/
4+
/blob-report/
5+
/playwright/.cache/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('Declarative Chart', async ({ page }) => {
4+
await page.goto('http://localhost:3000/');
5+
6+
await expect(page.getByText('Data Visualization')).toBeVisible();
7+
const combobox = page.getByRole('combobox');
8+
await expect(combobox).toHaveCount(1);
9+
await combobox.click();
10+
const listbox = page.locator('.ms-Callout-main');
11+
await expect(listbox).toHaveCount(1);
12+
const listitems = listbox.getByRole('option');
13+
const lisItemsCount = await listitems.count();
14+
for (let i = 0; i < lisItemsCount; i++) {
15+
if (i != 33) {
16+
await listitems.nth(i).scrollIntoViewIfNeeded();
17+
await listitems.nth(i).click();
18+
const chart = page.getByTestId('chart-container');
19+
await expect(chart).toHaveScreenshot();
20+
await combobox.click();
21+
}
22+
}
23+
});
16.2 KB
26.9 KB
13.1 KB
13.9 KB
13.7 KB

0 commit comments

Comments
 (0)