[e2e] Fix produce message test (#2619)
* fix tests on master * fix produceMessage() * fix produceMessage() * fix produceMessage()
This commit is contained in:
parent
cb0586bd44
commit
b4424fc960
5 changed files with 53 additions and 50 deletions
|
@ -3,6 +3,7 @@ package com.provectus.kafka.ui.pages;
|
||||||
import com.provectus.kafka.ui.pages.connector.ConnectorsList;
|
import com.provectus.kafka.ui.pages.connector.ConnectorsList;
|
||||||
import com.provectus.kafka.ui.pages.connector.ConnectorsView;
|
import com.provectus.kafka.ui.pages.connector.ConnectorsView;
|
||||||
import com.provectus.kafka.ui.pages.schema.SchemaRegistryList;
|
import com.provectus.kafka.ui.pages.schema.SchemaRegistryList;
|
||||||
|
import com.provectus.kafka.ui.pages.topic.ProduceMessagePanel;
|
||||||
import com.provectus.kafka.ui.pages.topic.TopicView;
|
import com.provectus.kafka.ui.pages.topic.TopicView;
|
||||||
import com.provectus.kafka.ui.pages.topic.TopicsList;
|
import com.provectus.kafka.ui.pages.topic.TopicsList;
|
||||||
import io.qameta.allure.Step;
|
import io.qameta.allure.Step;
|
||||||
|
@ -14,7 +15,7 @@ public class Pages {
|
||||||
public MainPage mainPage = new MainPage();
|
public MainPage mainPage = new MainPage();
|
||||||
public TopicsList topicsList = new TopicsList();
|
public TopicsList topicsList = new TopicsList();
|
||||||
public TopicView topicView = new TopicView();
|
public TopicView topicView = new TopicView();
|
||||||
public ProduceMessagePage produceMessagePage = new ProduceMessagePage();
|
public ProduceMessagePanel produceMessagePanel = new ProduceMessagePanel();
|
||||||
public ConnectorsList connectorsList = new ConnectorsList();
|
public ConnectorsList connectorsList = new ConnectorsList();
|
||||||
public ConnectorsView connectorsView = new ConnectorsView();
|
public ConnectorsView connectorsView = new ConnectorsView();
|
||||||
public SchemaRegistryList schemaRegistry = new SchemaRegistryList();
|
public SchemaRegistryList schemaRegistry = new SchemaRegistryList();
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.provectus.kafka.ui.pages;
|
|
||||||
|
|
||||||
import com.codeborne.selenide.Condition;
|
|
||||||
import com.codeborne.selenide.SelenideElement;
|
|
||||||
import com.provectus.kafka.ui.pages.topic.TopicView;
|
|
||||||
import io.qameta.allure.Step;
|
|
||||||
import org.openqa.selenium.By;
|
|
||||||
import org.openqa.selenium.Keys;
|
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
|
||||||
|
|
||||||
import static com.codeborne.selenide.Selenide.$;
|
|
||||||
import static com.codeborne.selenide.Selenide.Wait;
|
|
||||||
|
|
||||||
public class ProduceMessagePage{
|
|
||||||
|
|
||||||
private final SelenideElement keyField = $(By.xpath("//div[@id = 'key']/textarea"));
|
|
||||||
private final SelenideElement contentField = $(By.xpath("//div[@id = 'content']/textarea"));
|
|
||||||
private final SelenideElement headersField = $(By.xpath("//div[@id = 'headers']/textarea"));
|
|
||||||
private final SelenideElement sendBtn = $(By.xpath("//button[@type = 'submit']"));
|
|
||||||
@Step
|
|
||||||
public ProduceMessagePage setKeyField(String value) {
|
|
||||||
Wait().until(ExpectedConditions.urlContains("message"));
|
|
||||||
keyField.sendKeys(Keys.chord(Keys.DELETE));
|
|
||||||
keyField.setValue(value);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
@Step
|
|
||||||
public ProduceMessagePage setContentFiled(String value) {
|
|
||||||
Wait().until(ExpectedConditions.urlContains("message"));
|
|
||||||
contentField.sendKeys(Keys.DELETE);
|
|
||||||
contentField.setValue(value);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
@Step
|
|
||||||
public ProduceMessagePage setHeaderFiled(String value) {
|
|
||||||
headersField.setValue(value);
|
|
||||||
return new ProduceMessagePage();
|
|
||||||
}
|
|
||||||
@Step
|
|
||||||
public TopicView submitProduceMessage() {
|
|
||||||
sendBtn.shouldBe(Condition.visible).click();
|
|
||||||
return new TopicView();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.provectus.kafka.ui.pages.topic;
|
||||||
|
|
||||||
|
import com.codeborne.selenide.Condition;
|
||||||
|
import com.codeborne.selenide.SelenideElement;
|
||||||
|
import io.qameta.allure.Step;
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
import org.openqa.selenium.Keys;
|
||||||
|
|
||||||
|
import static com.codeborne.selenide.Selenide.$;
|
||||||
|
import static com.codeborne.selenide.Selenide.refresh;
|
||||||
|
|
||||||
|
public class ProduceMessagePanel {
|
||||||
|
|
||||||
|
private final SelenideElement keyField = $(By.xpath("//div[@id='key']/textarea"));
|
||||||
|
private final SelenideElement contentField = $(By.xpath("//div[@id='content']/textarea"));
|
||||||
|
private final SelenideElement headersField = $(By.xpath("//div[@id='headers']/textarea"));
|
||||||
|
private final SelenideElement submitBtn = headersField.$(By.xpath("../../../..//button[@type='submit']"));
|
||||||
|
|
||||||
|
@Step
|
||||||
|
public ProduceMessagePanel setKeyField(String value) {
|
||||||
|
keyField.shouldBe(Condition.enabled)
|
||||||
|
.sendKeys(Keys.chord(Keys.DELETE));
|
||||||
|
keyField.setValue(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Step
|
||||||
|
public ProduceMessagePanel setContentFiled(String value) {
|
||||||
|
contentField.shouldBe(Condition.enabled)
|
||||||
|
.sendKeys(Keys.DELETE);
|
||||||
|
contentField.setValue(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Step
|
||||||
|
public ProduceMessagePanel setHeaderFiled(String value) {
|
||||||
|
headersField.setValue(value);
|
||||||
|
return new ProduceMessagePanel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Step
|
||||||
|
public TopicView submitProduceMessage() {
|
||||||
|
submitBtn.shouldBe(Condition.enabled).click();
|
||||||
|
submitBtn.shouldBe(Condition.disappear);
|
||||||
|
refresh();
|
||||||
|
return new TopicView().waitUntilScreenReady();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,13 +5,11 @@ import com.codeborne.selenide.Selenide;
|
||||||
import com.codeborne.selenide.SelenideElement;
|
import com.codeborne.selenide.SelenideElement;
|
||||||
import com.provectus.kafka.ui.extensions.WaitUtils;
|
import com.provectus.kafka.ui.extensions.WaitUtils;
|
||||||
import com.provectus.kafka.ui.helpers.TestConfiguration;
|
import com.provectus.kafka.ui.helpers.TestConfiguration;
|
||||||
import com.provectus.kafka.ui.pages.ProduceMessagePage;
|
|
||||||
import com.provectus.kafka.ui.utils.BrowserUtils;
|
import com.provectus.kafka.ui.utils.BrowserUtils;
|
||||||
import io.qameta.allure.Step;
|
import io.qameta.allure.Step;
|
||||||
import lombok.experimental.ExtensionMethod;
|
import lombok.experimental.ExtensionMethod;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
|
|
||||||
import static com.codeborne.selenide.Selectors.byLinkText;
|
|
||||||
import static com.codeborne.selenide.Selenide.*;
|
import static com.codeborne.selenide.Selenide.*;
|
||||||
|
|
||||||
@ExtensionMethod({WaitUtils.class})
|
@ExtensionMethod({WaitUtils.class})
|
||||||
|
@ -56,9 +54,9 @@ public class TopicView {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Step
|
@Step
|
||||||
public ProduceMessagePage clickOnButton(String buttonName) {
|
public ProduceMessagePanel clickOnButton(String buttonName) {
|
||||||
BrowserUtils.javaExecutorClick($(By.xpath(String.format("//div//button[text()='%s']", buttonName))));
|
BrowserUtils.javaExecutorClick($(By.xpath(String.format("//div//button[text()='%s']", buttonName))));
|
||||||
return new ProduceMessagePage();
|
return new ProduceMessagePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Step
|
@Step
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class SmokeTests extends BaseTest {
|
public class SmokeTests extends BaseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@AutomationStatus(status = Status.AUTOMATED)
|
@AutomationStatus(status = Status.AUTOMATED)
|
||||||
@CaseId(198)
|
@CaseId(198)
|
||||||
|
@ -17,5 +18,4 @@ public class SmokeTests extends BaseTest {
|
||||||
.waitUntilScreenReady();
|
.waitUntilScreenReady();
|
||||||
compareScreenshots("main");
|
compareScreenshots("main");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue