Skip to content

Commit

Permalink
Question management integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 26, 2024
1 parent 3725378 commit 6b8b6dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/test/java/com/uniovi/steps/AdminTasksStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.uniovi.util.SeleniumUtils;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import org.junit.jupiter.api.Assertions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
Expand Down Expand Up @@ -83,4 +84,10 @@ public void iClickButtonForUser(String btn, String user) {
public void iShouldNotSeeTheText(String text) {
SeleniumUtils.waitInvisibleElement(driver, By.xpath("//*[contains(text(),'" + text + "')]"), 5);
}

@When("I click question management button")
public void iClickQuestionManagementButton() {
List<WebElement> elems = SeleniumUtils.waitLoadElements(driver, By.id("tab2-tab"), 5);
elems.get(0).click();
}
}
13 changes: 12 additions & 1 deletion src/test/resources/features/Admin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,15 @@ Feature: I do admin tasks
And I click "admin.user.delete" button for user "user1"
And I should see the modal dialog "admin.user.delete.title"
And I click "deleteModalConfirm" button
Then I should not see the text "user1"
Then I should not see the text "user1"

Scenario: I save question JSON
Given I am in the home page
When I click the login button
And I fill in the form with valid data email: "test" password: "test"
And I press the login button
Then I should see the admin zone button
And I enter the admin zone
And I should see the message "navbar.section.admin"
When I click question management button
Then I click "saveButton" button

0 comments on commit 6b8b6dc

Please sign in to comment.