/** * Uses the @Step annotation to log the given log message to Allure. * * @param message the message to log to the allure report */ @Step("{message}") public static void logToAllure(String message) { logger.debug("Logged to allure: " + message); }
/** * Open the page in browser */ @Step("Open page") @Override public T open() { webDriver.get(authorUrl + getFullUrl()); return (T) this; }
/** * open the page in browser */ @Step("Open page") public T open() { webDriver.get(getFullUrl()); return (T) this; }
/** * Opens the page in the edit mode * * @return self-reference */ @Step("Open page in editor") public T openInEditor() { webDriver.get(authorUrl + "/editor.html" + getFullUrl()); return (T) this; }
@Override @Step("Provide name {name}") public CreatePageWizard provideName(String name) { createPageProperties.getNameTextField().sendKeys(name); return this; }
/** * Open the page in browser */ @Step("Open page") @Override public T open() { webDriver.get(authorUrl + getFullUrl()); return (T) this; }
/** * Opens the page in the edit mode * * @return self-reference */ @Step("Open page in editor") public T openInEditor() { webDriver.get(authorUrl + "/editor.html" + getFullUrl()); return (T) this; }
@Override @Step("Provide title {title}") public CreatePageWizard provideTitle(String title) { createPageProperties.getTitleTextField().sendKeys(title); return this; }
@Override @Step("Logging out of AEM") public void execute() { webDriver.get(authorUrl + "/system/sling/logout.html"); aemAuthCookieFactory.removeCookie(authorUrl); } }
@Override @Step("Select template {templateName}") public CreatePageWizard selectTemplate(String templateName) { templateList.selectTemplate(templateName); getNextButton().click(); return this; }
@Attachment @Step("Make screen shot of results page") public byte[] makeScreenShot() { return ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES); }
@Override @Step("Submit page for creation") public void submit() { wait.until(input -> getCreateButton().isEnabled()); getCreateButton().click(); List<WebElement> elements = pageCreatedModal.findElements(By.xpath("//coral-button-label[contains(text(),'Done')]")); elements.stream() .findFirst() .orElseThrow(() -> new NoSuchElementException("\"Done\" button not found")) .click(); }
@Override @Step("Logging in to AEM") public void execute() { webDriver.get(authorUrl + "/libs/granite/core/content/login.html"); webDriver.manage() .addCookie(aemAuthCookieFactory.getCookie(authorUrl, authorLoginProperty, authorPassword)); } }
@Step public void search(String text) { driver.findElement(By.id("text")).sendKeys(text); driver.findElement(By.className("suggest2-form__button")).submit(); new WebDriverWait(driver, 10) .withMessage("Could not load results page") .until(mainContainLoaded()); }
@Step("Prepares a test attachment") private SoapAttachment getTestAttachment() { SoapAttachment attachment = mock(SoapAttachment.class); when(attachment.getContent()).thenReturn(IOUtils.toInputStream("Some Content")); when(attachment.getContentType()).thenReturn(MediaType.TEXT); return attachment; }
@Override @Step("Create page {data.title} with name {data.pageName} using {data.template} template") public void execute(CreatePageActionData data) { toolbar.createPage(data.getTemplate(), data.getTitle(), data.getPageName()); } }
@Override @Step("Edit component") public void execute(ComponentData data) { sidePanel.selectTab(SidePanelTabs.CONTENT_TREE.getCssClass()); sidePanel.selectComponentToEdit(data.getComponentPath(), data.getComponentName(), data.getComponentOrder()).click(); componentToolbar.clickOption(CommonToolbarOptions.EDIT.getTitle()); } }
@SuppressWarnings("unchecked") @Override @Step("Configure component") public void execute(ConfigureComponentData data) { selectComponent(data); componentToolbar.clickOption(CommonToolbarOptions.CONFIGURE.getTitle()); ComponentConfiguration componentConfiguration = componentConfigReader.readConfiguration(data.getConfigLocation()); configDialog.configureWith(componentConfiguration); }
@Override @Step("Returns an MTOM enricher that adds an XOP element to the XML referencing the attachment in the multipart message") protected AttachmentRequestEnricher getEnricher() { return new MtomRequestEnricher(model.getLoader().getValue()); }
@Override @Step("Returns an attachment enricher that adds the content of the attachment encoded to base64") protected AttachmentRequestEnricher getEnricher() { return new SoapAttachmentRequestEnricher(model.getLoader().getValue()); }