Commit 2646b911 authored by Vadim Nesmashnov's avatar Vadim Nesmashnov

RIHAKB-860, RIHA haldajana soovin, et RIHA manuaalsed funktsionaalsuse testid...

RIHAKB-860, RIHA haldajana soovin, et RIHA manuaalsed funktsionaalsuse testid oleks võimalikult suures ulatuses automatiseeritud
parent 13a18d92
......@@ -2,5 +2,5 @@ package ee.ria.riha;
public final class Timeouts {
public static final int TABLE_SORT_TIMEOUT = 2000;
public static final int DISPLAY_ELEMENT_TIMEOUT = 15000;
public static final int DISPLAY_ELEMENT_TIMEOUT = 15;
}
......@@ -6,7 +6,13 @@ import java.util.Map;
public class ScenarioContext {
public static final String APP_URL_KEY = "appUrl";
public static final String SEARCH_TEXT_KEY = "searchText";
public static final String NAME_KEY = "name";
public static final String SHORT_NAME_KEY = "shortName";
public static final String HOMEPAGE_KEY = "homepage";
public static final String PURPOSE_KEY = "purpose";
public static final String LAST_INFOSYSTEM_NUMBER = "lastInfosystemNumber";
public static final String DEFAULT_APP_URL = "https://riha-browser-ik.ci.kit";
private final Map<String, String> context = new HashMap<>();
......
......@@ -5,19 +5,74 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;
import java.util.stream.Collectors;
import static ee.ria.riha.Timeouts.DISPLAY_ELEMENT_TIMEOUT;
import static ee.ria.riha.context.ScenarioContext.*;
import static org.openqa.selenium.Keys.BACK_SPACE;
import static org.openqa.selenium.Keys.RETURN;
public class InfosystemPage extends BasePage {
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div[2]/div[2]/p")
private WebElement purposeP;
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div[2]/h1")
private WebElement nameDiv;
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div[2]/h2")
private WebElement shortNameDiv;
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div[2]/div[3]/div")
private WebElement topicsDiv;
@FindBy(css = ".ng2-tags-container")
private WebElement topicTagsContainer;
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div[2]/div[5]/div/label/a")
private WebElement homepageA;
@FindBy(xpath = "//div[@id='uldkirjeldus']/app-producer-details-general/section/div/button")
private WebElement editButton;
@FindBy(xpath = "//div[@id='kontaktid']/app-producer-details-contacts/section/div/button")
private WebElement editContactsButton;
@FindBy(xpath = "//div[@id='dokumentatsioon']/app-producer-details-tech-docs/section/div/button")
private WebElement editDocumentationButton;
@FindBy(xpath = "//div[@id='kontaktid']/app-producer-details-contacts/section/div[2]/table/tr/td[2]/span")
private WebElement contactNameSpan;
@FindBy(xpath = "//div[@id='kontaktid']/app-producer-details-contacts/section/div[2]/p")
private WebElement contactsP;
@FindBy(css = ".btn-success")
private WebElement saveButton;
@FindBy(id = "name-input")
private WebElement nameInput;
@FindBy(id = "short-name-input")
private WebElement shortNameInput;
@FindBy(id = "purpose-textarea")
private WebElement purposeTextarea;
@FindBy(id = "homepage")
private WebElement homepageInput;
@FindBy(css = ".ng2-tag-input__text-input")
private WebElement topicsInput;
@FindBy(css = "app-producer-details-tech-docs table")
private WebElement techDocTable;
@FindBy(tagName = "ngb-modal-window")
private WebElement modalContainer;
public InfosystemPage(ScenarioContext scenarioContext) {
super(scenarioContext);
PageFactory.initElements(driver, this);
......@@ -33,7 +88,138 @@ public class InfosystemPage extends BasePage {
return purposeP.getText();
}
public String getName() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, nameDiv, "nameDiv");
return nameDiv.getText();
}
public String getShortName() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, shortNameDiv, "shortNameDiv");
return shortNameDiv.getText();
}
public String getHomepage() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, homepageA, "homepageA");
return homepageA.getText();
}
public String getContactName() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, contactNameSpan, "contactNameSpan");
return contactNameSpan.getText();
}
public void clickOnTopic(String topic) {
topicsDiv.findElements(By.tagName("button")).stream().filter(button -> button.getText().equalsIgnoreCase(topic)).findFirst().get().click();
}
public void clickEditButton() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, editButton, "editButton");
editButton.click();
}
public void clickEditContactsButton() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, editContactsButton, "editContactsButton");
editContactsButton.click();
}
public void clickSaveButton() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, saveButton, "saveButton");
saveButton.click();
}
public void changeGeneralDescription(String suffix) {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, nameInput, "nameInput");
scenarioContext.saveToContext(NAME_KEY, nameInput.getAttribute("value"));
this.nameInput.sendKeys(suffix);
scenarioContext.saveToContext(SHORT_NAME_KEY, shortNameInput.getAttribute("value"));
shortNameInput.sendKeys(suffix);
scenarioContext.saveToContext(PURPOSE_KEY, purposeTextarea.getAttribute("value"));
purposeTextarea.sendKeys(suffix);
scenarioContext.saveToContext(HOMEPAGE_KEY, homepageInput.getAttribute("value"));
homepageInput.sendKeys(suffix);
}
public void revertChangesInGeneralDescription() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, nameInput, "nameInput");
nameInput.sendKeys(BACK_SPACE);
shortNameInput.sendKeys(BACK_SPACE);
purposeTextarea.sendKeys(BACK_SPACE);
homepageInput.sendKeys(BACK_SPACE);
}
public void enterContactNameAndEmail(String name, String email) {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, modalContainer, "modalContainer");
modalContainer.findElement(By.id("name")).sendKeys(name);
modalContainer.findElement(By.id("email")).sendKeys(email);
modalContainer.findElement(By.cssSelector(".col-12 > .btn")).click();
modalContainer.findElement(By.cssSelector(".btn-success")).click();
}
public void deleteContact() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, modalContainer, "modalContainer");
modalContainer.findElement(By.cssSelector(".btn-danger")).click();
modalContainer.findElement(By.cssSelector(".btn-success")).click();
}
public String getEmptyContactsPlaceholder() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, contactsP, "contactsP");
return contactsP.getText();
}
public void enterNewTopic(String topic) {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, topicsInput, "topicsInput");
topicsInput.sendKeys(topic);
topicsInput.sendKeys(RETURN);
}
public void removeTopic(String topic) {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, topicTagsContainer, "topicTagsContainer");
WebElement topicTag = topicTagsContainer.findElements(By.tagName("tag"))
.stream()
.filter(tag -> tag.findElement(By.tagName("div")).getAttribute("aria-label").equalsIgnoreCase(topic))
.findFirst()
.get();
topicTag.findElement(By.tagName("delete-icon")).click();
}
public void clickEditDocumentationButton() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, editDocumentationButton, "editDocumentationButton");
editDocumentationButton.click();
}
public void clickOnAddNewUrlButton() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, modalContainer, "modalContainer");
modalContainer.findElement(By.cssSelector(".btn-secondary:nth-child(2)")).click();
}
public void enterNewTechnicalDocumentationLink(String url, String name) {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, modalContainer, "modalContainer");
modalContainer.findElement(By.id("url")).sendKeys(url);
modalContainer.findElement(By.id("linkName")).sendKeys(name);
Select select = new Select(modalContainer.findElement(By.id("linkType")));
select.selectByValue("DOC_TYPE_OTHER");
wait.sleep(10000);
modalContainer.findElement(By.cssSelector(".col-12 > .btn")).click();
modalContainer.findElement(By.cssSelector(".btn-success")).click();
}
public String getTechDocUrls() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, techDocTable, "techDocTable");
return techDocTable.findElements(By.cssSelector(".name")).stream()
.map(td -> td.findElement(By.tagName("a")))
.map(WebElement::getText)
.collect(Collectors.joining(","));
}
}
......@@ -93,4 +93,5 @@ public class InfosystemsPage extends BasePage {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, infosystemsTable, "info-systems-table");
wait.sleep(TABLE_SORT_TIMEOUT);
}
}
......@@ -116,6 +116,11 @@ public class MyInfosystemsPage extends BasePage {
scenarioContext.saveToContext(LAST_INFOSYSTEM_NUMBER, shortName.substring(scenarioContext.getFromContext(SEARCH_TEXT_KEY).length() + 1));
}
public void selectFirstFoundInfosystem() {
WebElement firstRow = infosystemsTable.findElement(By.xpath("//tr[1]"));
firstRow.findElement(By.xpath("//td[1]")).findElement(By.tagName("a")).click();
}
private void waitForLoading() {
wait.forElementToBeDisplayed(DISPLAY_ELEMENT_TIMEOUT, infosystemsTable, "infosystems-table");
wait.sleep(TABLE_SORT_TIMEOUT);
......
......@@ -5,7 +5,8 @@ import ee.ria.riha.pages.HomePage;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import org.junit.Assert;
import static org.junit.Assert.assertTrue;
public class HomePageSteps {
private HomePage homePage;
......@@ -46,17 +47,17 @@ public class HomePageSteps {
@Then("HomePage: page title is {string}")
public void pageTitleIs(String title) {
Assert.assertTrue("Displayed title is " + homePage.getTitle() + " instead of " + title, title.equals(homePage.getTitle()));
assertTrue("Displayed title is " + homePage.getTitle() + " instead of " + title, title.equals(homePage.getTitle()));
}
@Then("HomePage: home page is opened showing logged in user's name {string}")
public void homePageIsOpenedShowingLoggedInUsersName(String name) {
homePage.selectSecondOrganization();
Assert.assertTrue("Displayed logged in user's name is " + homePage.getLoggedInUsersName() + " instead of " + name, homePage.getLoggedInUsersName().contains(name));
assertTrue("Displayed logged in user's name is " + homePage.getLoggedInUsersName() + " instead of " + name, homePage.getLoggedInUsersName().contains(name));
}
@Then("HomePage: organization name {string} is shown next to user's name")
public void organizationNameIsShownNextToUsersName(String organizationName) {
Assert.assertTrue("Organization name " + organizationName + " is not shown", homePage.getLoggedInUsersName().contains(organizationName));
assertTrue("Organization name " + organizationName + " is not shown", homePage.getLoggedInUsersName().contains(organizationName));
}
}
......@@ -3,6 +3,7 @@ package ee.ria.riha.infosystemmanagement;
import ee.ria.riha.driver.Setup;
import ee.ria.riha.pages.MyInfosystemsPage;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.junit.Assert;
......@@ -34,13 +35,19 @@ public class InfosystemManagementSteps {
myInfosystemsPage.enterNameShortNameAndPurpose(namePrefix, shortNamePrefix, purpose);
}
@And("MyInfosystemsPage: user knows the number of last created infosystem with prefix {string}")
@Given("MyInfosystemsPage: user knows the number of last created infosystem with prefix {string}")
public void userKnowsTheNameOfLastCreatedInfosystem(String namePrefix) {
myInfosystemsPage.enterSearchText(namePrefix);
myInfosystemsPage.sortByShortNameDesc();
myInfosystemsPage.saveFirstFoundInfosystemShortNameToScenarioContext();
}
@Given("MyInfosystemsPage: user select {string} infosystem")
public void userSelectsInfosystem(String shortName) {
myInfosystemsPage.enterSearchText(shortName);
myInfosystemsPage.selectFirstFoundInfosystem();
}
@When("MyInfosystemsPage: user clicks on {string} infosystem link")
public void userClicksOnIfosystemLink(String infosystem) {
myInfosystemsPage.goToInfosystemPage(infosystem);
......@@ -48,6 +55,6 @@ public class InfosystemManagementSteps {
@Then("MyInfosystemsPage: all displayed infosystems on 'my infosystems' page have {string} associated topic")
public void allDisplayedInfosystemsHaveTopic(String topic) {
myInfosystemsPage.getFoundInfosystemsTopics().forEach(topics -> Assert.assertTrue("Found infosystem desn't have associated topic " + topic, topics.contains(topic.toUpperCase())));
myInfosystemsPage.getFoundInfosystemsTopics().forEach(topics -> Assert.assertTrue("Found infosystem doesn't have associated topic " + topic, topics.contains(topic.toUpperCase())));
}
}
......@@ -2,9 +2,14 @@ package ee.ria.riha.infosystempage;
import ee.ria.riha.driver.Setup;
import ee.ria.riha.pages.InfosystemPage;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.junit.Assert;
import java.util.stream.Stream;
import static ee.ria.riha.context.ScenarioContext.*;
import static org.junit.Assert.*;
public class InfosystemPageSteps {
private InfosystemPage infosystemPage;
......@@ -18,13 +23,112 @@ public class InfosystemPageSteps {
infosystemPage.clickOnTopic(topic);
}
@And("InfosystemPage: user clicks on 'edit' button")
public void userClicksOnEditButton() {
infosystemPage.clickEditButton();
}
@And("InfosystemPage: user clicks on 'edit contacts' button")
public void userClicksOnEditContactsButton() {
infosystemPage.clickEditContactsButton();
}
@And("InfosystemPage: user clicks on 'edit documentation' button")
public void userClicksOnEditDocumentationButton() {
infosystemPage.clickEditDocumentationButton();
}
@And("InfosystemPage: user changes general description by adding {string} to all fields")
public void userChangesGeneralDescription(String suffix) {
infosystemPage.changeGeneralDescription(suffix);
}
@And("InfosystemPage: user reverts changes in general description")
public void userRevertsChangesInGeneralDescription() {
infosystemPage.revertChangesInGeneralDescription();
}
@And("InfosystemPage: user enters contact name {string} and email {string}")
public void userEntersContactNameAndEmail(String name, String email) {
infosystemPage.enterContactNameAndEmail(name, email);
}
@And("InfosystemPage: user clicks on 'add new URL' button")
public void userClicksOnAddNewUrlButton() {
infosystemPage.clickOnAddNewUrlButton();
}
@And("InfosystemPage: user enters new technical documentation link {string} with name {string}")
public void userEntersNewTechnicalDocumentationLink(String url, String name) {
infosystemPage.enterNewTechnicalDocumentationLink(url, name);
}
@And("InfosystemPage: user enters new topic {string}")
public void userEntersNewTopic(String topic) {
infosystemPage.enterNewTopic(topic);
}
@And("InfosystemPage: user removes topic {string}")
public void userRemovesTopic(String topic) {
infosystemPage.removeTopic(topic);
}
@And("InfosystemPage: user clicks on 'delete contacts' button")
public void userDeletesContact() {
infosystemPage.deleteContact();
}
@And("InfosystemPage: user clicks on 'save' button")
public void userClicksOnSaveButton() {
infosystemPage.clickSaveButton();
}
@Then("InfosytemPage: {string} topic is present in associated topics list")
public void topicIsPresentInAssociatedTopicsList(String topic) {
Assert.assertTrue("Associated topic list doen't contain topic " + topic, infosystemPage.getAssociatedTopicsList().contains(topic.toUpperCase()));
assertTrue("Associated topic list doesn't contain topic " + topic, infosystemPage.getAssociatedTopicsList().contains(topic.toUpperCase()));
}
@Then("InfosystemPage: link to technical documentation with name {string} presents in 'documentation' block")
public void linkToTechnicalDocumentationPresentsInDocBlock(String linkName) {
assertTrue("Documentation block doesn't have documentation link " + linkName,
infosystemPage.getTechDocUrls().contains(linkName));
}
@Then("InfosytemPage: {string} topic is not present in associated topics list")
public void topicIsNotPresentInAssociatedTopicsList(String topic) {
assertFalse("Associated topic list contains topic " + topic,
Stream.of(infosystemPage.getAssociatedTopicsList().split(","))
.anyMatch(associatedTopic -> associatedTopic.equalsIgnoreCase(topic)));
}
@Then("InfosytemPage: infosystem creation purpose is {string}")
public void infosystemCreationPurposeIs(String purpose) {
Assert.assertTrue("Infosystem creation purpose is not " + purpose, purpose.equalsIgnoreCase(infosystemPage.getPurposeText()));
assertTrue("Infosystem creation purpose is not " + purpose, purpose.equalsIgnoreCase(infosystemPage.getPurposeText()));
}
@Then("InfosytemPage: infosystem short name, name, creation purpose and homepage url end with {string}")
public void infosystemShortNameNameAndCreationPurposeEndWith(String suffix) {
assertTrue("Infosystem name doesn't end with " + suffix, infosystemPage.getName().endsWith(suffix));
assertTrue("Infosystem short name doesn't end with " + suffix, infosystemPage.getShortName().endsWith(suffix));
assertTrue("Infosystem creation purpose doesn't end with " + suffix, infosystemPage.getPurposeText().endsWith(suffix));
assertTrue("Infosystem homepage doesn't end with " + suffix, infosystemPage.getHomepage().endsWith(suffix));
}
@Then("InfosytemPage: infosystem general description is restored")
public void infosystemGeneralDescriptionIsRestored() {
assertTrue("Infosystem name is not restored ", infosystemPage.getScenarioContext().getFromContext(NAME_KEY).equalsIgnoreCase(infosystemPage.getName()));
assertEquals("Infosystem short name is not restored ", infosystemPage.getScenarioContext().getFromContext(SHORT_NAME_KEY), infosystemPage.getShortName());
assertEquals("Infosystem creation purpose is not restored ", infosystemPage.getScenarioContext().getFromContext(PURPOSE_KEY).trim(), infosystemPage.getPurposeText().trim());
assertEquals("Infosystem homepage is not restored ", infosystemPage.getScenarioContext().getFromContext(HOMEPAGE_KEY), infosystemPage.getHomepage());
}
@Then("InfosystemPage: contact name {string} is visible in 'contacts' block")
public void contactNameIsVisibleInContactsBlock(String name) {
assertEquals("Infosystem doesn't have contact " + infosystemPage.getContactName(), name, infosystemPage.getContactName());
}
@Then("InfosystemPage: placeholder {string} is visible in 'contacts' block")
public void placeholderIsVisibleInContactsBlock(String text) {
assertEquals("Empty contacts placeholder is wrong", text, infosystemPage.getEmptyContactsPlaceholder());
}
}
......@@ -4,7 +4,8 @@ import ee.ria.riha.driver.Setup;
import ee.ria.riha.pages.InfosystemsPage;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Then;
import org.junit.Assert;
import static org.junit.Assert.assertTrue;
public class InfosystemsPageSteps {
private InfosystemsPage infosystemsPage;
......@@ -20,7 +21,7 @@ public class InfosystemsPageSteps {
@And("InfosytemsPage: topic input has {string} text")
public void topicInputHasText(String text) {
Assert.assertTrue("Wrong text in topic input " + infosystemsPage.getTopicInputText(), text.equalsIgnoreCase(infosystemsPage.getTopicInputText()));
assertTrue("Wrong text in topic input " + infosystemsPage.getTopicInputText(), text.equalsIgnoreCase(infosystemsPage.getTopicInputText()));
}
@And("InfosystemsPage: user enters 'owner name' {string}, 'name' {string} and 'search topic' {string} and presses 'enter'")
......@@ -30,26 +31,26 @@ public class InfosystemsPageSteps {
@Then("InfosytemsPage: all displayed infosystems on 'infosystems' page have {string} associated topic")
public void allDisplayedInfosystemsHaveTopic(String topic) {
infosystemsPage.getFoundInfosystemsTopics().forEach(topics -> Assert.assertTrue("Found infosystem desn't have associated topic " + topic, topics.contains(topic.toUpperCase())));
infosystemsPage.getFoundInfosystemsTopics().forEach(topics -> assertTrue("Found infosystem desn't have associated topic " + topic, topics.contains(topic.toUpperCase())));
}
@Then("InfosystemsPage: URL contains 'ownerName={string}', 'name={string}' and 'topic={string}' elements")
public void urlContainsOwnerNameAndtopicElements(String ownerName, String name, String topic) {
Assert.assertTrue("Search URL doesn't contain 'ownerName' element", infosystemsPage.getCurrentUrl().contains("ownerName=" + ownerName));
Assert.assertTrue("Search URL doesn't contain 'name' element", infosystemsPage.getCurrentUrl().contains("name=" + name));
Assert.assertTrue("Search URL doesn't contain 'topic' element", infosystemsPage.getCurrentUrl().contains("topic=" + topic));
assertTrue("Search URL doesn't contain 'ownerName' element", infosystemsPage.getCurrentUrl().contains("ownerName=" + ownerName));
assertTrue("Search URL doesn't contain 'name' element", infosystemsPage.getCurrentUrl().contains("name=" + name));
assertTrue("Search URL doesn't contain 'topic' element", infosystemsPage.getCurrentUrl().contains("topic=" + topic));
}
@Then("InfosytemsPage: 'owner' input has {string} text, 'name' input has {string} text and 'topic' input has {string} text")
public void inputsHaveAppropriateText(String ownerName, String name, String topic) {
Assert.assertTrue("Wrong text in owner input " + infosystemsPage.getTopicInputText(), ownerName.equalsIgnoreCase(infosystemsPage.getOwnerInputText()));
Assert.assertTrue("Wrong text in name input " + infosystemsPage.getTopicInputText(), name.equalsIgnoreCase(infosystemsPage.getNameInputText()));
Assert.assertTrue("Wrong text in topic input " + infosystemsPage.getTopicInputText(), topic.equalsIgnoreCase(infosystemsPage.getTopicInputText()));
assertTrue("Wrong text in owner input " + infosystemsPage.getTopicInputText(), ownerName.equalsIgnoreCase(infosystemsPage.getOwnerInputText()));
assertTrue("Wrong text in name input " + infosystemsPage.getTopicInputText(), name.equalsIgnoreCase(infosystemsPage.getNameInputText()));
assertTrue("Wrong text in topic input " + infosystemsPage.getTopicInputText(), topic.equalsIgnoreCase(infosystemsPage.getTopicInputText()));
}
@And("InfosytemsPage: found infosystem with short name {string}")
public void foundInfosystemHasShortName(String shortName) {
Assert.assertTrue("Infosystem with short name " + shortName + " not found", infosystemsPage.getFoundInfosystemsShortName().stream().anyMatch(shortName::equalsIgnoreCase));
assertTrue("Infosystem with short name " + shortName + " not found", infosystemsPage.getFoundInfosystemsShortName().stream().anyMatch(shortName::equalsIgnoreCase));
}
}
......@@ -2,10 +2,51 @@ Feature: My organization infosystems page functionality
Background:
Given User is logged in to "/" as "60001019906" using tel. number "00000766"
And HomePage: user opens 'my organization infosystems' page
Scenario: User can create new infosystem (RIHAKB-340)
Given HomePage: user opens 'my organization infosystems' page
And MyInfosystemsPage: user knows the number of last created infosystem with prefix "autotest"
Given MyInfosystemsPage: user knows the number of last created infosystem with prefix "autotest"
And MyInfosystemsPage: user clicks 'Lisa uus'
And MyInfosystemsPage: user enters name as "RIHA autotest number" short name as "autotest" increasing last number and purpose as "Testida RIHA funktsionaalsust"
Then InfosytemPage: infosystem creation purpose is "Testida RIHA funktsionaalsust"
\ No newline at end of file
Then InfosytemPage: infosystem creation purpose is "Testida RIHA funktsionaalsust"
Scenario: User can change general infosystem description (RIHAKB-370)
Given MyInfosystemsPage: user select "riha-test" infosystem
And InfosystemPage: user clicks on 'edit' button
And InfosystemPage: user changes general description by adding "1" to all fields
And InfosystemPage: user clicks on 'save' button
Then InfosytemPage: infosystem short name, name, creation purpose and homepage url end with "1"
And InfosystemPage: user clicks on 'edit' button
And InfosystemPage: user reverts changes in general description
And InfosystemPage: user clicks on 'save' button
Then InfosytemPage: infosystem general description is restored
Scenario: User can enter and edit infosystem topic (RIHAKB-324)
Given MyInfosystemsPage: user select "riha-test" infosystem
And InfosystemPage: user clicks on 'edit' button
And InfosystemPage: user enters new topic "test"
And InfosystemPage: user clicks on 'save' button
Then InfosytemPage: "test" topic is present in associated topics list
And InfosystemPage: user clicks on 'edit' button
And InfosystemPage: user removes topic "test"
And InfosystemPage: user clicks on 'save' button
Then InfosytemPage: "test" topic is not present in associated topics list
Scenario: User can enter URL to infosystem technical documentation (RIHAKB-355)
Given MyInfosystemsPage: user select "riha-test" infosystem
And InfosystemPage: user clicks on 'edit documentation' button
And InfosystemPage: user clicks on 'add new URL' button
And InfosystemPage: user enters new technical documentation link "https://www.riha.ee" with name "RIHA veebileht"
Then InfosystemPage: link to technical documentation with name "RIHA veebileht" presents in 'documentation' block
And InfosystemPage: user clicks on 'edit documentation' button
# And InfosystemPage: user removes link to technical documentation with descr. "RIHA veebileht"
# Then InfosystemPage: link to technical documentation with name "RIHA veebileht" not present in 'documentation' block
Scenario: User can add contact to infosystem (RIHAKB-357)
Given MyInfosystemsPage: user select "riha-test" infosystem
And InfosystemPage: user clicks on 'edit contacts' button
And InfosystemPage: user enters contact name "Marje Karu" and email "marje.karu@gmail.com"
Then InfosystemPage: contact name "Marje Karu" is visible in 'contacts' block
And InfosystemPage: user clicks on 'edit contacts' button
And InfosystemPage: user clicks on 'delete contacts' button
Then InfosystemPage: placeholder "Kontaktid puuduvad" is visible in 'contacts' block
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment