Skip to content

Commit

Permalink
Merge pull request #1740 from jdi-testing/issue_1714-fix-validation-f…
Browse files Browse the repository at this point in the history
…or-locator-name

Issue 1714: fix validation for locator name
  • Loading branch information
Iogsotot authored May 28, 2024
2 parents 98b2aa1 + 2bdc2b3 commit 7bccbcb
Show file tree
Hide file tree
Showing 60 changed files with 447 additions and 375 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "JDN — Page Object Generator",
"description": "JDN – helps Test Automation Engineer to create Page Objects in the test automation framework and speed up test development",
"devtools_page": "index.html",
"version": "3.15.34",
"version": "3.15.35",
"icons": {
"128": "icon128.png"
},
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdn-ai-chrome-extension",
"version": "3.15.34",
"version": "3.15.35",
"description": "jdn-ai chrome extension",
"scripts": {
"start": "webpack --watch --env devenv",
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/__mocks__/locator.mock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const locator1 = {
attrId: '',
element_id: '8736312404689610766421832473',
elementId: '8736312404689610766421832473',
is_shown: true,
height: 201.3333435059,
locatorValue: {
Expand All @@ -26,7 +26,7 @@ export const locator1 = {

export const locator2 = {
attrId: '',
element_id: '2222222222',
elementId: '2222222222',
is_shown: true,
height: 201.3333435059,
locatorValue: {
Expand All @@ -49,7 +49,7 @@ export const locator2 = {

export const locator3 = {
attrId: '',
element_id: '333333333333333',
elementId: '333333333333333',
is_shown: true,
height: 201.3333435059,
locatorValue: {
Expand Down
44 changes: 22 additions & 22 deletions src/__tests__/__mocks__/pageObjectMocks/elementsWithoutNames.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const elementsWithoutNames = [
{
element_id: '7824983223872788250093302805',
elementId: '7824983223872788250093302805',
is_shown: true,
predicted_label: 'radiogroup',
elemId: 'radio79',
Expand All @@ -11,7 +11,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '3976799717872788243800691939',
elementId: '3976799717872788243800691939',
is_shown: true,
predicted_label: 'list',
elemId: 'radio79',
Expand All @@ -22,7 +22,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '2531946027872788259730157905',
elementId: '2531946027872788259730157905',
is_shown: true,
predicted_label: 'list',
elemId: 'radio79',
Expand All @@ -33,7 +33,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1788878284872788254954433922',
elementId: '1788878284872788254954433922',
is_shown: true,
predicted_label: 'badge',
elemId: 'anyNymber',
Expand All @@ -44,7 +44,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '8073262067872788257041578300',
elementId: '8073262067872788257041578300',
is_shown: true,
predicted_label: 'chip',
elemId: '',
Expand All @@ -55,7 +55,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '8162387396872788255600213565',
elementId: '8162387396872788255600213565',
is_shown: true,
predicted_label: 'chip',
elemId: '',
Expand All @@ -66,7 +66,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '3824832072872788248203820469',
elementId: '3824832072872788248203820469',
is_shown: true,
predicted_label: 'badge',
elemId: 'anyNymber',
Expand All @@ -77,7 +77,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412332',
elementId: '1195797979872788259469412332',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -88,7 +88,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412444',
elementId: '1195797979872788259469412444',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -99,15 +99,15 @@ export const elementsWithoutNames = [
},
},
{
element_id: '3265985627872788257228708643',
elementId: '3265985627872788257228708643',
is_shown: true,
predicted_label: 'button',
locator: {
fullXpath: '/html/body/header/div/nav/ul[2]/li/div/div/button',
},
},
{
element_id: '3901491381872788252561828171',
elementId: '3901491381872788252561828171',
is_shown: true,
predicted_label: 'button',
elemId: '1001loginButton',
Expand All @@ -116,7 +116,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '9384531537872788240323543297',
elementId: '9384531537872788240323543297',
is_shown: true,
predicted_label: 'menu',
elemId: ' menu Foo ',
Expand All @@ -125,7 +125,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '3901491381872788252561828179',
elementId: '3901491381872788252561828179',
is_shown: true,
predicted_label: 'button',
elemId: '1001loginButton',
Expand All @@ -134,7 +134,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412450',
elementId: '1195797979872788259469412450',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -145,7 +145,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412460',
elementId: '1195797979872788259469412460',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -156,7 +156,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412460',
elementId: '1195797979872788259469412460',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -167,7 +167,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '1195797979872788259469412000',
elementId: '1195797979872788259469412000',
is_shown: true,
predicted_label: 'list',
elemId: '',
Expand All @@ -178,7 +178,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '7824983223872788250093302',
elementId: '7824983223872788250093302',
is_shown: true,
predicted_label: 'radiogroup',
elemAriaLabel: 'Click this control',
Expand All @@ -188,7 +188,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '78249832238727882500933021',
elementId: '78249832238727882500933021',
is_shown: true,
predicted_label: 'radiogroup',
elemAriaLabel: 'Click this control with very long text text text text text text text text text 123',
Expand All @@ -198,7 +198,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '78249832238727882500933022',
elementId: '78249832238727882500933022',
is_shown: true,
predicted_label: 'radiogroup',
elemAriaLabel: 'Click this control with very long text text text text text text text text text 123',
Expand All @@ -208,7 +208,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '782498322387278825009330223',
elementId: '782498322387278825009330223',
is_shown: true,
predicted_label: 'radiogroup',
elemAriaLabel: 'Кнопка вызова единорога',
Expand All @@ -218,7 +218,7 @@ export const elementsWithoutNames = [
},
},
{
element_id: '782498322387278825009330200',
elementId: '782498322387278825009330200',
is_shown: true,
predicted_label: 'radiogroup',
elemText: 'A string with non-latin (любой) unicode character ’ we expect to exclude ',
Expand Down
34 changes: 17 additions & 17 deletions src/__tests__/__mocks__/pageObjectMocks/pageObject.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const getLocatorsByAnnotationType = (value) => {
return [
{
attrId: '',
element_id: '0955274655778840492142094709',
elementId: '0955274655778840492142094709',
is_shown: true,
height: 60,
locatorValue: {
Expand All @@ -28,7 +28,7 @@ export const getLocatorsByAnnotationType = (value) => {
},
{
attrId: '',
element_id: '2022378243778840502461724770',
elementId: '2022378243778840502461724770',
is_shown: true,
height: 15.3333339691,
locatorValue: {
Expand All @@ -52,7 +52,7 @@ export const getLocatorsByAnnotationType = (value) => {
},
{
attrId: '',
element_id: '2713188863778840498565585241',
elementId: '2713188863778840498565585241',
is_shown: true,
height: 38.6666679382,
locatorValue: {
Expand All @@ -79,7 +79,7 @@ export const getLocatorsByAnnotationType = (value) => {
export const locators = [
{
attrId: '',
element_id: '0955274655778840492142094709',
elementId: '0955274655778840492142094709',
is_shown: true,
height: 60,
locatorValue: {
Expand All @@ -103,7 +103,7 @@ export const locators = [
},
{
attrId: '',
element_id: '2022378243778840502461724770',
elementId: '2022378243778840502461724770',
is_shown: true,
height: 15.3333339691,
locatorValue: {
Expand All @@ -127,7 +127,7 @@ export const locators = [
},
{
attrId: '',
element_id: '2713188863778840498565585241',
elementId: '2713188863778840498565585241',
is_shown: true,
height: 38.6666679382,
locatorValue: {
Expand All @@ -153,7 +153,7 @@ export const locators = [
export const locatorsWithFindBy = [
{
attrId: '',
element_id: '0955274655778840492142094709',
elementId: '0955274655778840492142094709',
is_shown: true,
height: 60,
locatorValue: {
Expand All @@ -177,7 +177,7 @@ export const locatorsWithFindBy = [
},
{
attrId: '',
element_id: '2022378243778840502461724770',
elementId: '2022378243778840502461724770',
is_shown: true,
height: 15.3333339691,
locatorValue: {
Expand All @@ -201,7 +201,7 @@ export const locatorsWithFindBy = [
},
{
attrId: '',
element_id: '2713188863778840498565585241',
elementId: '2713188863778840498565585241',
is_shown: true,
height: 38.6666679382,
locatorValue: {
Expand All @@ -226,10 +226,10 @@ export const locatorsWithFindBy = [

export const locatorsVividus = [
{
element_id: '0057770603115098154872149076_0',
elementId: '0057770603115098154872149076_0',
is_shown: true,
predicted_label: 'label',
childs: ['1052464727115098158766915230'],
// childs: ['1052464727115098158766915230'],
displayed: false,
jdnHash: '0057770603115098154872149076',
pageObj: 0,
Expand Down Expand Up @@ -257,10 +257,10 @@ export const locatorsVividus = [
locatorType: LocatorType.cssSelector,
},
{
element_id: '0735357117115098156691382591_0',
elementId: '0735357117115098156691382591_0',
is_shown: true,
predicted_label: 'label',
childs: null,
// childs: null,
displayed: false,
jdnHash: '0735357117115098156691382591',
pageObj: 0,
Expand Down Expand Up @@ -292,10 +292,10 @@ export const locatorsVividus = [
isGenerated: true,
},
{
element_id: '0790139442115098150038335533_0',
elementId: '0790139442115098150038335533_0',
is_shown: true,
predicted_label: 'textarea',
childs: null,
// childs: null,
displayed: false,
jdnHash: '0790139442115098150038335533',
pageObj: 0,
Expand Down Expand Up @@ -327,10 +327,10 @@ export const locatorsVividus = [
isGenerated: true,
},
{
element_id: '0928942213115098152027249027_0',
elementId: '0928942213115098152027249027_0',
is_shown: true,
predicted_label: 'label',
childs: null,
// childs: null,
displayed: false,
jdnHash: '0928942213115098152027249027',
pageObj: 0,
Expand Down
Loading

0 comments on commit 7bccbcb

Please sign in to comment.