diff --git a/components/Modal/CreateImageUpload.js b/components/Modal/CreateImageUpload.js index ee138af46..548ad7d32 100644 --- a/components/Modal/CreateImageUpload.js +++ b/components/Modal/CreateImageUpload.js @@ -72,6 +72,45 @@ const messages = defineMessages({ } }); +const ariaLabels = defineMessages({ + uploadImage: { + id: "upload-image-help", + defaultMessage: "Upload image help" + }, + processLength: { + id: "provess-length-help", + defaultMessage: "Process length help" + }, + imageSize: { + id: "image-size-help", + defaultMessage: "Image size help" + }, + accessKeyID: { + id: "access-key-id-help", + defaultMessage: "Access key ID help" + }, + secretAccessKey: { + id: "secret-access-key-help", + defaultMessage: "Secret access key help" + }, + imageName: { + id: "image-name-help", + defaultMessage: "Image name help" + }, + bucket: { + id: "bucket-help", + defaultMessage: "S3 Bucket help" + }, + region: { + id: "region-help", + defaultMessage: "AWS region help" + }, + aws: { + id: "aws-help", + defaultMessage: "AWS help" + } +}); + class CreateImageUpload extends React.Component { constructor(props) { super(props); @@ -380,9 +419,9 @@ class CreateImageUploadModal extends React.Component {

} - aria-label="Upload image help" + aria-label={formatMessage(ariaLabels.uploadImage)} > - @@ -397,7 +436,6 @@ class CreateImageUploadModal extends React.Component { defaultMessage: `Upload to AWS` })} id="aws-checkbox" - aria-labelledby="provider-checkbox" /> @@ -453,9 +491,9 @@ class CreateImageUploadModal extends React.Component { - @@ -484,9 +522,9 @@ class CreateImageUploadModal extends React.Component { - @@ -564,9 +602,9 @@ class CreateImageUploadModal extends React.Component { }} /> } - aria-label="access key id help" + aria-label={formatMessage(ariaLabels.accessKeyID)} > - @@ -600,9 +638,9 @@ class CreateImageUploadModal extends React.Component { }} /> } - aria-label="secret access key help" + aria-label={formatMessage(ariaLabels.secretAccessKey)} > - @@ -646,9 +684,9 @@ class CreateImageUploadModal extends React.Component { } - aria-label="image name help" + aria-label={formatMessage(ariaLabels.imageName)} > - @@ -688,9 +726,9 @@ class CreateImageUploadModal extends React.Component { /> } - aria-label="bucket help" + aria-label={formatMessage(ariaLabels.bucket)} > - @@ -724,9 +762,9 @@ class CreateImageUploadModal extends React.Component { }} /> } - aria-label="region help" + aria-label={formatMessage(ariaLabels.region)} > - @@ -789,9 +827,9 @@ class CreateImageUploadModal extends React.Component {

} - aria-label="aws help" + aria-label={formatMessage(ariaLabels.aws)} > - @@ -965,8 +1003,11 @@ class CreateImageUploadModal extends React.Component { <FormattedMessage defaultMessage="Create and upload image" /> - <Popover bodyContent={formatMessage(messages.infotip)} aria-label="process length help"> - <Button variant="plain" aria-label="process length help"> + <Popover + bodyContent={formatMessage(messages.infotip)} + aria-label={formatMessage(ariaLabels.processLength)} + > + <Button variant="plain" aria-label={formatMessage(ariaLabels.processLength)}> <OutlinedQuestionCircleIcon id="popover-icon" /> </Button> </Popover> diff --git a/test/verify/check-image b/test/verify/check-image index d315ee51b..00dfb85cf 100755 --- a/test/verify/check-image +++ b/test/verify/check-image @@ -20,22 +20,22 @@ class TestImage(composerlib.ComposerCase): # create image wizard (no upload support) b.click("li[data-blueprint=httpd-server] #create-image-button") b.wait_text("#create-image-upload-wizard #blueprint-name", "httpd-server") - # check ? (process length help) button - b.click("button[aria-label='process length help']") - b.wait_attr("button[aria-label='process length help']", "aria-expanded", "true") + # check ? (Process length help) button + b.click("button[aria-label='Process length help']") + b.wait_attr("button[aria-label='Process length help']", "aria-expanded", "true") b.wait_text(".pf-c-popover__body", "This process can take a while. " "Images are built in the order they are started.") b.click(".pf-c-popover__content button") - b.wait_attr("button[aria-label='process length help']", "aria-expanded", "false") + b.wait_attr("button[aria-label='Process length help']", "aria-expanded", "false") # check ? (image size help) button - b.click("button[aria-label='image size help']") - b.wait_attr("button[aria-label='image size help']", "aria-expanded", "true") + b.click("button[aria-label='Image size help']") + b.wait_attr("button[aria-label='Image size help']", "aria-expanded", "true") b.wait_text(".pf-c-popover__body", "Set the size that you want the image to be when instantiated. The total " "package size and target destination of your image should be considered when " "setting the image size.") b.click(".pf-c-popover__content button") - b.wait_attr("button[aria-label='image size help']", "aria-expanded", "false") + b.wait_attr("button[aria-label='Image size help']", "aria-expanded", "false") # check non upload image action (Create only) # group actions for select from dropdown menu b.wait_visible("#image-type")