Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
06eede7
work for #523 add new dropdown and button widgets. update plotly config
Jun 27, 2025
f575a42
work for #523 update tooltip styles
Jun 27, 2025
943eff9
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jun 30, 2025
496f0ad
update drag area indicator
Jun 30, 2025
a07d581
work for #523 update gauge & bullet styles
Jun 30, 2025
0a96ab3
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jun 30, 2025
b8a6779
work for #523 update e2e tests
Jul 1, 2025
7aa6734
work for #523 fix visual tests
Jul 1, 2025
88750b4
work for #523 update pivot editors
Jul 1, 2025
c7567d7
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 2, 2025
c887a15
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 2, 2025
f0cfdde
work for #523 fix f-tests
Jul 2, 2025
a0e5104
work for #523 fix visual tests
Jul 2, 2025
dc130cb
work for #523
Jul 2, 2025
1e85b04
work for #523 fix unit tests
Jul 2, 2025
1b5c1c3
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 2, 2025
7a3aeb1
work for #523 fix vbar marker colors
Jul 2, 2025
784f09e
work for #523 fix bar setting
Jul 2, 2025
d0be3ac
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 4, 2025
6a5154a
work for #523 skip unit tests
Jul 4, 2025
4066779
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 7, 2025
dd2db67
work for #523 fix bar setting
Jul 8, 2025
794a210
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 9, 2025
3876853
work for #523 fix bar setting
Jul 9, 2025
0e48b62
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 10, 2025
b651951
work for #523 new styles for nps visualization
Jul 10, 2025
fd6af6d
work for #523 new styles for statistics table
Jul 10, 2025
4cffdf7
work for #523 new styles for tables
Jul 10, 2025
4ea2446
update "Poll Visualizer Example" example
Jul 10, 2025
0b251f3
work for #523 new styles for tabulator
Jul 10, 2025
d33aa2e
work for #523 remove grid background-color
Jul 11, 2025
16ad708
work for #523 bug fixes
Jul 11, 2025
ff9d1b6
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 11, 2025
f62c768
work for #523 update font-size
Jul 14, 2025
963c73f
work for #523 put toolbar items in one line
Jul 15, 2025
0ee46b1
work for #523 extract dashboard theme
Jul 15, 2025
611f5a4
add ApexCharts
Jul 16, 2025
34f2a6d
theming ApexCharts
Jul 18, 2025
3239435
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 23, 2025
847e4cf
theming ApexCharts
Jul 23, 2025
07a19ce
theming ApexCharts
Jul 25, 2025
722bd98
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 25, 2025
161779b
add Radar chart
Jul 25, 2025
1b7535a
apply dashboard theme
Jul 29, 2025
afb1ab0
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 29, 2025
2b3b1c8
apply dashboard theme
Jul 30, 2025
606b26c
apply radar char theme settings
Jul 30, 2025
1de7dde
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Jul 30, 2025
9ac45e6
work for #523 fix after merge master
Jul 30, 2025
e792d0b
work for #523 fix visual test
Jul 31, 2025
cc5782e
work for #523 fix visual tests for apexcharts
Jul 31, 2025
2f54871
Fixed small styling issues
Aug 4, 2025
935449e
Updated references
Aug 4, 2025
57a8121
work for #523 apply new theme
Aug 8, 2025
f07a887
work for #523 dynamic theme change
Aug 11, 2025
172c06b
work for #523 fix design by default
Aug 11, 2025
046682a
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Aug 12, 2025
24c2938
work for #523 fix after master merged
Aug 12, 2025
c503b4d
work for #523 fix after master merged
Aug 12, 2025
bee7756
work for #523 fix tests
Aug 13, 2025
ffc742e
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Aug 13, 2025
b4eb87d
work for #523 fix pipeline
Aug 13, 2025
7618859
work for #523 add themes
Aug 13, 2025
587cc10
work for #523 gauge
Aug 13, 2025
57b6cad
work for #523 gauge
Aug 14, 2025
9952687
work for #523 radar
Aug 14, 2025
217ec8a
work for #523 fix histogram color
Aug 14, 2025
13fe5bb
work for #523 redesign filter editor
Aug 14, 2025
a197756
work for #523 rename variables
Aug 15, 2025
ca7e714
resolve #231 Redesign the question selector
Aug 18, 2025
38de4a0
resolve #572 Update the design of the toolbars
Aug 19, 2025
9266910
work for #523 fix charts
Aug 20, 2025
a6faf0c
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Aug 20, 2025
e4fef1c
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Aug 20, 2025
03af7d7
work for #523 add license into pivot
Aug 20, 2025
974f504
work for #523 small fixes
Aug 20, 2025
2342a3d
add accessibility tests
Aug 21, 2025
c3f1af4
Fixed plotly click processing after update
Aug 22, 2025
5f030e5
work for #523 small fixes
Aug 22, 2025
eef6e84
work for #523 fix visibility apexchart after hidding
Aug 25, 2025
4f26510
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Aug 27, 2025
bf12ba4
work for #523 keyboard navigation for button
Aug 27, 2025
db35df0
work for #523 keyboard navigation for dropdown
Aug 27, 2025
dc93ee7
work for #523 keyboard navigation for dropdown
Aug 27, 2025
5893fc8
work for #523 fix f-tests
Aug 27, 2025
ea90ac1
work for #523 fix tests
Aug 28, 2025
593e703
work for #523 add toggle
Aug 28, 2025
a5179e6
work for #532 Adopt dashboard for mobile devices
Aug 29, 2025
80659e8
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 1, 2025
84f8a11
work for #523 fix tests
Sep 1, 2025
03b4f63
work for #523 small fixes
Sep 2, 2025
50ee546
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 2, 2025
c281a1d
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 2, 2025
4aecf4f
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 3, 2025
176a9c4
support percentagePrecision into apexcharts
Sep 3, 2025
8d0f0b7
resolve #495 Enable the NPS Visualizer for specific questions only
Sep 3, 2025
ade732b
resolve #577 Implement "total answers count" visualizer
Sep 3, 2025
d2fa37c
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 5, 2025
8945a77
work for #523 small fixes
Sep 5, 2025
c88bfe9
work for #523 small fixes
Sep 5, 2025
2db742a
Fixed #619 - A11Y: Chart titles should be readable
Sep 11, 2025
1f6d585
work for #571 Create a new design for "Table View for Survey Data"
Sep 12, 2025
e41bf31
add fonts
Sep 12, 2025
ae633e2
add theme to tabulator
Sep 12, 2025
4caf6b1
include themes
Sep 15, 2025
1b5beea
Fixed #604 - Plotly chart: horizontal bar labels are cut off
Sep 15, 2025
f2d9a29
Merge branch 'issue/523-new-design-for-survey-dashboards' of https://…
Sep 15, 2025
d462df2
Fixed unit tests related to document.font API usage
Sep 15, 2025
4ccbebb
work for #523 fix build
Sep 15, 2025
d5dd57c
work for #523 fix unit tests
Sep 15, 2025
ef9e011
Moved group role to the top visualizer div
Sep 16, 2025
366d8d3
work for #523 add fonts
Sep 17, 2025
9c6a8a6
work for #523
Sep 17, 2025
0b840f4
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 17, 2025
1ec933f
work for #523 fix unit tests
Sep 17, 2025
4b41798
resolve #577 use ICalculationResult
Sep 17, 2025
5ad30d4
work for #577 Implement "total answers count" visualizer
Sep 17, 2025
076bf8c
work for #577 Implement "total answers count" visualizer
Sep 18, 2025
bc1b13c
work for #577 fix unit tests
Sep 18, 2025
cc49c8a
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Sep 18, 2025
9d0c2e1
fix for lint
Sep 19, 2025
6275fcc
work for #577 fix f-tests
Sep 19, 2025
fe1a22a
work for #577 fix f-tests
Sep 22, 2025
550170b
resolve #577 use ICalculationResult
Sep 22, 2025
c7b887f
work for #577 fix f-tests
Sep 22, 2025
f45d830
resolve #577 use ICalculationResult
Sep 22, 2025
d0254f5
work for #577 fix f-tests
Sep 22, 2025
6c48b87
resolve #495 Enable the NPS Visualizer for specific questions only
Sep 22, 2025
8c357f9
add example pages with apexcharts
Sep 23, 2025
923846c
work for #523 fix apexcharts
Sep 23, 2025
af72be1
work for #523 fix apexcharts
Sep 24, 2025
297e5ce
work for #523 fix apexcharts
Sep 24, 2025
2367097
resolve #577 Implement "total answers count" visualizer
Sep 25, 2025
7c7315c
work for #571 Create a new design for "Table View for Survey Data"
Sep 30, 2025
ec496bb
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Oct 1, 2025
11e2d89
Small fixes theme
Oct 1, 2025
49a7637
update unit tests
Oct 1, 2025
e2eb90c
work for #495 Enable the NPS Visualizer for specific questions only
Oct 1, 2025
2b67ec7
Merge branch 'master' into issue/523-new-design-for-survey-dashboards
Oct 8, 2025
bc54d14
Fixed build and small issues
Oct 8, 2025
9b2ffab
Fixed lint
Oct 8, 2025
a5ebc2f
remove test-duplicate
Oct 8, 2025
e0ebd9b
Refactoring: extracted muuri layout manager to get rid of it in the f…
Oct 8, 2025
597e144
Merge branch 'issue/523-new-design-for-survey-dashboards' of https://…
Oct 8, 2025
2a0dde9
Refactored types build config
Oct 8, 2025
7addc60
Refactoring - made Pivot a descendant of Histogram model
Oct 8, 2025
d1975c0
work for #523 Create a new design for survey dashboards
Oct 8, 2025
507a9f6
Merge branch 'issue/523-new-design-for-survey-dashboards' of github.c…
Oct 8, 2025
67872af
fix reser filter button for panel
Oct 9, 2025
41872c4
Merge branch 'master' into issue/523-new-design-for-survey-dashboards
Oct 9, 2025
57c7ed4
tabulator update colums editor
Oct 9, 2025
b7e295d
tabulator update colums editor
Oct 10, 2025
0286046
fix dashboard styles for Disable the Layout Engine
Oct 10, 2025
453505c
fix reser filter button for panel
Oct 10, 2025
3eab83a
fix switch localization
Oct 13, 2025
f559c6a
update declarative example
Oct 14, 2025
25c7bd2
Merge branch 'master' of github.com:surveyjs/survey-analytics into is…
Oct 15, 2025
abc3e43
Updated table example with new options
Oct 15, 2025
7a6325e
add themed summary example
Oct 15, 2025
be0cdd6
Added analytics plotly build setup
Oct 15, 2025
75b9bed
resolve #532 Adopt dashboard for mobile devices
Oct 15, 2025
aa7419a
Merge branch 'master' into issue/523-new-design-for-survey-dashboards
tsv2013 Oct 15, 2025
b4bf1c8
Merge branch 'master' into issue/523-new-design-for-survey-dashboards
Oct 16, 2025
368edfc
Merge branch 'issue/523-new-design-for-survey-dashboards' of https://…
Oct 16, 2025
edd309b
fix test
Oct 16, 2025
010cff8
fix pie chart tooltip styles
Oct 16, 2025
c0ed699
fix apexChart height
Oct 17, 2025
56c2aad
work for #532 Adopt dashboard for mobile devices
Oct 17, 2025
4be0b94
work for #532 Adopt dashboard for mobile devices
Oct 20, 2025
83721ae
work for #532 fix legend position for plotly
Oct 20, 2025
d4b3061
Fixed #393 - Add fontless analytics css
Oct 21, 2025
c9fbb9f
resolve #287 A timeline which would allow users to set a custom date …
Oct 21, 2025
92d572f
work for #287 A timeline which would allow users to set a custom date…
Oct 22, 2025
2efa630
Work for #287 - A timeline which would allow users to set a custom da…
Oct 22, 2025
3b7451b
Work for #287 - A timeline which would allow users to set a custom da…
Oct 22, 2025
933c235
Work for #287 - A timeline which would allow users to set a custom da…
Oct 22, 2025
57a1a10
Work for #287 - add invalid editor styles
Oct 22, 2025
7462f72
Work for #287 add error message & update answer count
Oct 23, 2025
a861d99
work for #532 Adopt dashboard for mobile devices
Oct 23, 2025
4965dc2
work for #532 Adopt dashboard for mobile devices
Oct 23, 2025
b41a847
work for #572 Update the design of the toolbars
Oct 24, 2025
5a0708c
work for #287 Custom date range - visual tests
Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions accessibilityTests/helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Page } from "@playwright/test";
import { RunOptions } from "axe-core";

export const FLOAT_PRECISION = 0.01;

// https://www.deque.com/axe/core-documentation/api-documentation/#overview
export const axeTags = ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "best-practice", "section508", "wcag412"];

export const axeOptions: RunOptions = {
runOnly: {
type: "tag",
values: axeTags
},
rules: {
//https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md
"color-contrast": {
enabled: false
},
"document-title": {
enabled: false
},
"landmark-one-main": {
enabled: false
},
"page-has-heading-one": {
enabled: false
},
"region": {
enabled: false
}
}
};

export function getListItemByText(page, text) {
return page.getByRole("option", { name: text, exact: true });
}
108 changes: 108 additions & 0 deletions accessibilityTests/matrixes.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import { axeOptions, getListItemByText } from "./helper";
import { checkA11y, injectAxe } from "axe-playwright";
import { test } from "@playwright/test";

test.describe("Matrixes visualizer", () => {
test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:8080/examples/matrixes.html");
await page.waitForLoadState("networkidle");
await injectAxe(page);
});

test("matrix single", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "What is your perception of these brands?" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content");
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });

const transposeButtonSelector = questionVisualizerSelector.locator(".sa-toolbar__button").filter({ hasText: /^Per Columns$/ });
await transposeButtonSelector.click();

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("matrixdropdown simple", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "What do you feel about these brands?" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const column1TitleSelector = page.locator("h3").filter({ hasText: "My Opinion" });
const column1VisualizerSelector = column1TitleSelector.locator("..").locator("..");
column1VisualizerSelector.scrollIntoViewIfNeeded();

const chartCol1TypeSelector = column1VisualizerSelector.locator(".sa-dropdown").nth(1);
const chartCol1ContentSelector = column1VisualizerSelector.locator(".sa-visualizer__content").nth(1);
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Vertical Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });

const transposeButtonSelector = column1VisualizerSelector.locator(".sa-toolbar__button").filter({ hasText: /^Per Columns$/ });
await transposeButtonSelector.click();

await chartCol1TypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Vertical Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });

await chartCol1TypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });
});

});
70 changes: 70 additions & 0 deletions accessibilityTests/misc.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { axeOptions, getListItemByText } from "./helper";
import { checkA11y, injectAxe } from "axe-playwright";
import { test } from "@playwright/test";

test.describe("Miscellaneous cases", () => {
test.beforeEach(async ({ page }) => {
});

test("matrix one row", async ({ page }) => {
await page.goto("http://localhost:8080/examples/matrix-one-row.html");
await injectAxe(page);
await page.setViewportSize({ width: 800, height: 1000 });
const axeContext = "#summaryContainer";

const questionTitleSelector = page.locator("h3").filter({ hasText: "Please indicate if you agree or disagree with the following statements" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content");

await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

const transposeButtonSelector = questionVisualizerSelector.locator(".sa-toolbar__button").filter({ hasText: /^Per Columns$/ });
await transposeButtonSelector.click();

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("matrix dropdown grouped", async ({ page }) => {
await page.goto("http://localhost:8080/examples/matrixdropdown-grouped.html");
await injectAxe(page);
await page.setViewportSize({ width: 800, height: 1000 });

const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "Please select the top 3 processes that you perceived as most difficult or troublesome." });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content");

await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

const transposeButtonSelector = questionVisualizerSelector.locator(".sa-toolbar__button").filter({ hasText: /^Per Columns$/ });
await transposeButtonSelector.click();

await chartTypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });
});
});
42 changes: 42 additions & 0 deletions accessibilityTests/pivot.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { axeOptions, getListItemByText } from "./helper";
import { checkA11y, injectAxe } from "axe-playwright";
import { test } from "@playwright/test";

test.describe("Pivot chart", () => {
test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:8080/examples/pivot.html");
await injectAxe(page);
await page.setViewportSize({ width: 1000, height: 800 });
});

test("simple cases", async ({ page }) => {
const axeContext = "#pivotContainer";
const xAxisSelector = page.locator(".sa-dropdown-header").nth(1);
const yAxisSelector = page.locator(".sa-dropdown-header").nth(2);
await checkA11y(page, axeContext, { axeOptions });

await yAxisSelector.click();
await getListItemByText(page, "Item kind").click();
await checkA11y(page, axeContext, { axeOptions });
await yAxisSelector.click();
await getListItemByText(page, "Bill amount").click();
await checkA11y(page, axeContext, { axeOptions });
await xAxisSelector.click();
await getListItemByText(page, "Item kind").click();
await yAxisSelector.click();
await getListItemByText(page, "Gender").click();
await checkA11y(page, axeContext, { axeOptions });
await yAxisSelector.click();
await getListItemByText(page, "Bill amount").click();
await checkA11y(page, axeContext, { axeOptions });
await xAxisSelector.click();
await getListItemByText(page, "Bill amount").click();
await yAxisSelector.click();
await getListItemByText(page, "Gender").click();
await checkA11y(page, axeContext, { axeOptions });
await yAxisSelector.click();
await getListItemByText(page, "Item kind").click();
await checkA11y(page, axeContext, { axeOptions });
});

});
122 changes: 122 additions & 0 deletions accessibilityTests/summary.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import { axeOptions, getListItemByText } from "./helper";
import { checkA11y, injectAxe } from "axe-playwright";
import { test } from "@playwright/test";

test.describe("Summary common", () => {
test.beforeEach(async ({ page }) => {
await page.goto("http://localhost:8080/examples/summary.html");
await injectAxe(page);
await page.setViewportSize({ width: 800, height: 1000 });
});

test("matrix simple cases", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "Please indicate if you agree or disagree with the following statements" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content");
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Stacked Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("boolean simple cases", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "Please answer the question" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content");
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("select simple cases", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "Which of the following best describes you or your organization?" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const visualizerSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").nth(1);
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content").nth(1);
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Vertical Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Pie").click();
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Doughnut").click();
await checkA11y(page, axeContext, { axeOptions });

await visualizerSelector.click();
await getListItemByText(page, "Table").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("simple cases", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "How likely are you to recommend SurveyJS to a friend or colleague?" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const visualizerSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").nth(1);
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content").nth(1);
await checkA11y(page, axeContext, { axeOptions });

await chartTypeSelector.click();
await getListItemByText(page, "Bar").click();
await checkA11y(page, axeContext, { axeOptions });

await visualizerSelector.click();
await getListItemByText(page, "Average").click();

const gaugeTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").nth(1);
await checkA11y(page, axeContext, { axeOptions });

await gaugeTypeSelector.click();
await getListItemByText(page, "Bullet").click();
await checkA11y(page, axeContext, { axeOptions });
});

test("text simple cases", async ({ page }) => {
const axeContext = "#summaryContainer";
const questionTitleSelector = page.locator("h3").filter({ hasText: "What's your favorite functionality / add-on?" });
const questionVisualizerSelector = questionTitleSelector.locator("..").locator("..");
questionVisualizerSelector.scrollIntoViewIfNeeded();

const visualizerTypeSelector = questionVisualizerSelector.locator(".sa-dropdown").first();
const chartContentSelector = questionVisualizerSelector.locator(".sa-visualizer__content").nth(1);
await checkA11y(page, axeContext, { axeOptions });

await visualizerTypeSelector.click();
await getListItemByText(page, "Texts in table").click();
await checkA11y(page, axeContext, { axeOptions });
});
});
Loading
Loading