From d6a342d0175a2bcc59d238aefc871db62b9bac58 Mon Sep 17 00:00:00 2001 From: Alejandro Visiedo Date: Tue, 23 Jan 2024 13:25:56 +0100 Subject: [PATCH] HMS-3432 feat: add ouiaid attribute This add the ouiaid attribute at all the considered places so the selection of the components does not depends on the xpath or dom structure of the page. Signed-off-by: Alejandro Visiedo --- src/Components/DomainList/DomainList.tsx | 7 +++- src/Routes/DefaultPage/DefaultPage.tsx | 22 +++++++++-- .../DetailGeneral/DetailGeneral.tsx | 37 ++++++++++++++++--- .../DetailServers/DetailServers.tsx | 3 +- src/Routes/DetailPage/DetailPage.tsx | 7 ++-- .../PagePreparation/PagePreparation.tsx | 17 +++++++-- .../Components/PageReview/PageReview.tsx | 7 ++-- .../PageServiceDetails/PageServiceDetails.tsx | 13 ++++++- .../PageServiceRegistration.tsx | 10 +++-- .../VerifyRegistry/VerifyRegistry.tsx | 16 ++++++-- src/Routes/WizardPage/WizardPage.tsx | 3 +- 11 files changed, 109 insertions(+), 33 deletions(-) diff --git a/src/Components/DomainList/DomainList.tsx b/src/Components/DomainList/DomainList.tsx index 5eecdbc..21c6192 100644 --- a/src/Components/DomainList/DomainList.tsx +++ b/src/Components/DomainList/DomainList.tsx @@ -187,14 +187,17 @@ export const DomainList = () => { { title: 'Enable/Disable', onClick: () => onEnableDisable(domain), + ouiaId: 'ButtonActionEnableDisable', }, { title: 'Edit', onClick: () => console.log(`clicked on Edit, on row ${domain.title}`), + ouiaId: 'ButtonActionEdit', }, { title: 'Delete', onClick: () => onDelete(domain), + ouiaId: 'ButtonActionDelete', }, ]; @@ -228,15 +231,17 @@ export const DomainList = () => { } else { rowActions[0].title = 'Enable'; } + let row = 1; return ( <> - + diff --git a/src/Routes/DefaultPage/DefaultPage.tsx b/src/Routes/DefaultPage/DefaultPage.tsx index cc4e84f..947432e 100644 --- a/src/Routes/DefaultPage/DefaultPage.tsx +++ b/src/Routes/DefaultPage/DefaultPage.tsx @@ -36,10 +36,19 @@ const Header = () => { return ( - +

Manage registered identity domains to leverage host access controls from your existing identity and access management.{' '} -

@@ -78,7 +87,9 @@ const EmptyContent = () => {
cloud environment*. To get started, register an identity domain. - + @@ -180,7 +192,9 @@ const ListContent = () => { - + diff --git a/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx b/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx index 4c7e357..773f729 100644 --- a/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx +++ b/src/Routes/DetailPage/Components/DetailGeneral/DetailGeneral.tsx @@ -178,6 +178,7 @@ export const DetailGeneral = (props: DetailGeneralProps) => { setIsTitleModalOpen(true); return; }} + ouiaId="ButtonDetailGeneralEditTitle" > @@ -205,6 +206,7 @@ export const DetailGeneral = (props: DetailGeneralProps) => { setEditDescription(description); setIsDescriptionModalOpen(true); }} + ouiaId="ButtonDetailGeneralEditDescription" > @@ -229,6 +231,7 @@ export const DetailGeneral = (props: DetailGeneralProps) => { onClick={() => { props.onShowServerTab && props.onShowServerTab(); }} + ouiaId="ButtonDetailGeneralEditAutoenrollment" > {domain?.['rhel-idm']?.servers.length} @@ -255,7 +258,14 @@ export const DetailGeneral = (props: DetailGeneralProps) => { - + @@ -277,6 +287,7 @@ export const DetailGeneral = (props: DetailGeneralProps) => { new Error('not implemented'); return; }} + ouiaId="LinkDetailGeneralCertificate" > @@ -291,27 +302,41 @@ export const DetailGeneral = (props: DetailGeneralProps) => { title="Edit display name" isOpen={isTitleModalOpen} onClose={handleCancelTitleButton} + ouiaId="ModalTitle" actions={[ - , - , ]} > - setEditTitle(value)} /> + setEditTitle(value)} ouiaId="TextModalDomainTitle" /> + , - , ]} diff --git a/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx b/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx index 8ab09f9..a1ff7f0 100644 --- a/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx +++ b/src/Routes/DetailPage/Components/DetailServers/DetailServers.tsx @@ -96,6 +96,7 @@ export const DetailServers = (props: DetailServersProps) => { activeSortIndex !== null && servers.sort(createCompareRows(activeSortIndex, activeSortDirection)); // FIXME Is subscription_manager_id unique? + let row = 1; return ( <> @@ -117,7 +118,7 @@ export const DetailServers = (props: DetailServersProps) => { {servers.map((server) => ( - + {server.fqdn} {server.location} {server.hcc_enrollment_server ? 'Yes' : 'No'} diff --git a/src/Routes/DetailPage/DetailPage.tsx b/src/Routes/DetailPage/DetailPage.tsx index af547b2..f005119 100644 --- a/src/Routes/DetailPage/DetailPage.tsx +++ b/src/Routes/DetailPage/DetailPage.tsx @@ -103,6 +103,7 @@ const DetailPage = () => { }); } }} + ouiaId="ButtonDetailsDelete" > Delete , @@ -121,7 +122,7 @@ const DetailPage = () => { - + { aria-label="Tabs in the detail page" role="region" > - General} eventKey={0} /> - Servers} eventKey={1} /> + General} eventKey={0} ouiaId="ButtonDetailGeneral" /> + Servers} eventKey={1} ouiaId="ButtonDetailServers" /> diff --git a/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx b/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx index 345f37e..8b55bfa 100644 --- a/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx +++ b/src/Routes/WizardPage/Components/PagePreparation/PagePreparation.tsx @@ -75,14 +75,21 @@ const PagePreparation = (props: PagePreparationProps) => { return ( <> - Preparation for your identity domain registration + + Preparation for your identity domain registration +
{ console.debug('TODO onSubmit WizardPage' + String(value)); }} > - +
    @@ -96,6 +103,7 @@ const PagePreparation = (props: PagePreparationProps) => { iconPosition="right" isInline href={prerequisitesLink} + ouiaId="ButtonWizardPagePreparePrerequisites" > prerequisites @@ -105,7 +113,7 @@ const PagePreparation = (props: PagePreparationProps) => { Verify whether or not the package is present on your Red Hat IdM server(s) by running the following command in a terminal on your Red Hat IdM server(s): - + dnf list installed ipa-hcc-server @@ -118,10 +126,11 @@ const PagePreparation = (props: PagePreparationProps) => { iconPosition="right" isInline href={installServerPackagesLink} + ouiaId="LinkWizardPagePrepareInstall" > steps to install the server packages - + dnf copr enable copr.devel.redhat.com/cheimes/ipa-hcc && dnf install ipa-hcc-server diff --git a/src/Routes/WizardPage/Components/PageReview/PageReview.tsx b/src/Routes/WizardPage/Components/PageReview/PageReview.tsx index 5f49410..338b478 100644 --- a/src/Routes/WizardPage/Components/PageReview/PageReview.tsx +++ b/src/Routes/WizardPage/Components/PageReview/PageReview.tsx @@ -52,11 +52,12 @@ interface PageReviewIpaServersProps { * @see {@link PageReviewIpa} about the parent component. */ const PageReviewIpaServersBody = (props: PageReviewIpaServersProps) => { + let row = 1; return ( {props.servers?.map((server) => { return ( - + {server.fqdn} {server.subscription_manager_id} @@ -77,7 +78,7 @@ const PageReviewIpaServersBody = (props: PageReviewIpaServersProps) => { const PageReviewIpaServers = (props: PageReviewIpaServersProps) => { return ( <> - + @@ -163,7 +164,7 @@ interface PageReviewProps { const PageReview = (props: PageReviewProps) => { return ( <> - + <Title className="pt-u-mb-xl" headingLevel={'h2'} ouiaId="TextWizardReviewTitle"> Review {props.domain.domain_type === 'rhel-idm' && } diff --git a/src/Routes/WizardPage/Components/PageServiceDetails/PageServiceDetails.tsx b/src/Routes/WizardPage/Components/PageServiceDetails/PageServiceDetails.tsx index b998890..92889a6 100644 --- a/src/Routes/WizardPage/Components/PageServiceDetails/PageServiceDetails.tsx +++ b/src/Routes/WizardPage/Components/PageServiceDetails/PageServiceDetails.tsx @@ -70,9 +70,17 @@ const PageServiceDetails = (props: PageServiceDetailsProps) => { return ( <> e.preventDefault()}> - Add your identity domain information + + Add your identity domain information + - +