diff --git a/src/test/java/com/uniovi/steps/AdminTasksStep.java b/src/test/java/com/uniovi/steps/AdminTasksStep.java index 128f70ad..3a678162 100644 --- a/src/test/java/com/uniovi/steps/AdminTasksStep.java +++ b/src/test/java/com/uniovi/steps/AdminTasksStep.java @@ -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; @@ -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 elems = SeleniumUtils.waitLoadElements(driver, By.id("tab2-tab"), 5); + elems.get(0).click(); + } } diff --git a/src/test/resources/features/Admin.feature b/src/test/resources/features/Admin.feature index 4a52685c..e83ed0b8 100644 --- a/src/test/resources/features/Admin.feature +++ b/src/test/resources/features/Admin.feature @@ -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" \ No newline at end of file + 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 \ No newline at end of file