Skip to content

Commit

Permalink
use @skbkontur/react-selenium-testing package
Browse files Browse the repository at this point in the history
  • Loading branch information
fakefeik committed Jan 16, 2024
1 parent f978dee commit e090eca
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 561 deletions.
4 changes: 3 additions & 1 deletion db-viewer-ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "./react-selenium-testing";
import "./react-selenium-prep";
import "@skbkontur/react-selenium-testing";

import React from "react";
import ReactDom from "react-dom";
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
Expand Down
1 change: 1 addition & 0 deletions db-viewer-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
},
"devDependencies": {
"@skbkontur/icons": "^1.3.0",
"@skbkontur/react-selenium-testing": "^0.2.1",
"@skbkontur/react-ui": "^4.1.0",
"@storybook/addon-actions": "^7.0.7",
"@storybook/addons": "^7.0.7",
Expand Down
30 changes: 30 additions & 0 deletions db-viewer-ui/react-selenium-prep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { ReactSeleniumTestingType } from "@skbkontur/react-selenium-testing";

const customization: ReactSeleniumTestingType = {
attributeWhiteList: {
error: [/.*/],
warning: [/.*/],
disabled: [/.*/],
"data-page-number": [/.*/],
disablePortal: ["ComboBoxRenderer"],
checked: [/.*/],
items: ["RadioGroup"],
value: [/Input|Textarea|RadioGroup|FilteredInput/],
activePage: ["Paging"],
pagesCount: ["Paging"],
trigger: [/Tooltip|ValidationTooltip|ValidationWrapper|ValidationWrapperV1/],
active: [/.*/],
className: [/.*/],
"data-active": [/.*/],
},
acceptAttribute: (prevAcceptResult, componentName, propName) => {
if (componentName === "Select" && propName === "items") {
return true;
}
return prevAcceptResult;
},
};

window.global ||= window;

global.ReactSeleniumTesting = customization;
Loading

0 comments on commit e090eca

Please sign in to comment.