Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SITES-22335] fix e2e tests for 6.5 and SDK #2826

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public class ImageEditDialog extends Dialog {
private static String altValueFromPageImage = "[name='./altValueFromPageImage']";
private static String imageFromPageImage = "[name='./imageFromPageImage']";
private static String titleValueFromDAM = "[name='./titleValueFromDAM']";
private static String altValueDoNotProvide = "[name='./isDecorative']";
private static String smartCropSelectButton = "[name='./smartCropRendition'] > button";
private static String linkTarget = "coral-checkbox[name='./linkTarget']";
private static String smartCropField = ".cmp-image__editor-dynamicmedia-smartcroprendition[name='./smartCropRendition']";

Expand Down Expand Up @@ -150,6 +152,11 @@ public void checkTitleValueFromDAM() {
checkbox.click();
}

public void checkAltValueDoNotProvide() {
CoralCheckbox checkbox = new CoralCheckbox(altValueDoNotProvide);
checkbox.click();
}

public void clickLinkTarget() {
CoralCheckbox checkbox = new CoralCheckbox(linkTarget);
checkbox.click();
Expand Down Expand Up @@ -181,6 +188,7 @@ public boolean isPopUpTitle() {
}

public void selectSmartCrop(String cropName) {
$(smartCropSelectButton).click();
CoralSelectList coralSelectList = new CoralSelectList($(smartCropField));
if (!coralSelectList.isVisible()) {
CoralSelect selectList = new CoralSelect($(smartCropField));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class TeaserEditDialog {
private static String titleFromPage = ".cmp-teaser__editor input[name='./titleFromPage']";
private static String preTitle = ".cmp-teaser__editor input[name='./pretitle']";
private static String title = ".cmp-teaser__editor input[name='./jcr:title']";
private static String altText = ".cmp-teaser__editor input[name='./alt']";
private static String descriptionFromPage = ".cmp-teaser__editor input[name='./descriptionFromPage']";
private static String description = ".cmp-teaser__editor div[name='./jcr:description']";
private static String actionsEnabled = ".cmp-teaser__editor coral-checkbox[name='./actionsEnabled']";
Expand Down Expand Up @@ -88,6 +89,11 @@ public void setDescription(String value) {
$(description).sendKeys(value);
}

public void setALTText(String value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase

Suggested change
public void setALTText(String value) {
public void setAltText(String value) {

$(altText).clear();
$(altText).sendKeys(value);
}

public void clickTitleFromPage() {
CoralCheckbox checkbox = new CoralCheckbox(titleFromPage);
checkbox.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ public void testSmartCropOnNGDMImageV3(String cropName) throws TimeoutException,
ImageEditDialog editDialog = image.getEditDialog();
editDialog.checkImageFromPageImage();
editDialog.selectSmartCrop(cropName);
editDialog.checkAltValueDoNotProvide();
Commons.saveConfigureDialog();
editorPage.enterPreviewMode();
Commons.switchContext("ContentFrame");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ public void testNoImageTeaser() throws TimeoutException, InterruptedException {
assertEquals(editDialog.getAssetWithoutDescriptionErrorMessage(), "Error: Please provide an asset which has a description that can be used as alt text.");
editDialog.checkImageFromPageImage();
editDialog.checkAltTextFromAssetDescription();
editDialog.setALTText("alt");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase

Suggested change
editDialog.setALTText("alt");
editDialog.setAltText("alt");

Commons.saveConfigureDialog();
Commons.switchContext("ContentFrame");
assertTrue(!teaser.isImagePresent(testPage), "Image should not be present");
Expand Down
Loading