Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AYS-191 | Application Listing Page Tests #36

Merged
merged 10 commits into from
Mar 20, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public static class AdminUserOne {
public static final String USERNAME = PROPERTIES.getProperty("institution_one.admin_user_one.username");
public static final String PASSWORD = PROPERTIES.getProperty("institution_one.admin_user_one.password");
}
public static class SuperAdminUserOne {
cagla88 marked this conversation as resolved.
Show resolved Hide resolved
public static final String USERNAME = PROPERTIES.getProperty("institution.super_admin_user_one.username");
public static final String PASSWORD = PROPERTIES.getProperty("institution.super_admin_user_one.password");
}
}

private static class AysConfigurationException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Regression @Smoke
Feature: Testing Super Admin Registration List

Background:
Given Open the institution login page
When Enter the super admin username and password
And Click the Login button

Scenario: Testing registration list by super admin user
When Click on the registration-application
When Click filter icon
And Selects available option from the status menu
Then Click filter button
cagla88 marked this conversation as resolved.
Show resolved Hide resolved
35 changes: 35 additions & 0 deletions src/test/java/org/ays/pages/SuperAdminPOM.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.ays.pages;

import lombok.Getter;
import org.ays.browser.AysBrowser;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

@Getter
public class SuperAdminPOM {
public SuperAdminPOM() {
PageFactory.initElements(AysBrowser.getWebDriver(), this);
}

@FindBy(xpath = "//a[normalize-space()='Registration Applications']")
private WebElement registrationApplication;

@FindBy(xpath = "//button[@class='ant-btn css-2sv4ty ant-btn-default ant-btn-icon-only']")
private WebElement filterIcon;

@FindBy(xpath = "//div[@class='ant-select-selection-overflow']")
private WebElement statusBar;

@FindBy(xpath = "//div[@id='statuses_list_0']")
private WebElement waiting;

@FindBy(xpath = "//button[@id='filter-button']")
private WebElement filtersButton;





cagla88 marked this conversation as resolved.
Show resolved Hide resolved
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.ays.step_definitions;

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.ays.browser.AysPageActions;
import org.ays.configuration.AysConfigurationProperty;
import org.ays.pages.LoginPOM;
import org.ays.pages.SuperAdminPOM;

public class SuperAdminRegistrationFilter {
private final LoginPOM loginPOM = new LoginPOM();
private final AysPageActions pageActions = new AysPageActions();
private final SuperAdminPOM superAdminPOM = new SuperAdminPOM();
cagla88 marked this conversation as resolved.
Show resolved Hide resolved

@When("Enter the super admin username and password")
public void enter_the_username_and_password() {
this.pageActions.sendKeysMethod(loginPOM.getLoginUsername(), AysConfigurationProperty.InstitutionOne.SuperAdminUserOne.USERNAME);
this.pageActions.sendKeysMethod(loginPOM.getLoginPassword(), AysConfigurationProperty.InstitutionOne.SuperAdminUserOne.PASSWORD);
}

@When("Click on the registration-application")
public void Click_on_the_assignments_tab() {
pageActions.waitUntilClickable(superAdminPOM.getRegistrationApplication());
pageActions.clickMethod(superAdminPOM.getRegistrationApplication());
}

@And("Click filter icon")
public void Click_on_the_filter_icon() {
pageActions.moveToElement(superAdminPOM.getFilterIcon());
pageActions.waitUntilClickable(superAdminPOM.getFilterIcon());
pageActions.clickElementWithJavaScript(superAdminPOM.getFilterIcon());
}

@And("Selects available option from the status menu")
public void Select_the_available_option_from_the_status_menu() {
pageActions.clickMethod(superAdminPOM.getStatusBar());
pageActions.clickElementWithJavaScript(superAdminPOM.getWaiting());
pageActions.clickMethod(superAdminPOM.getStatusBar());
}

@Then("Click filter button")
public void Click_on_the_filter_button() {
pageActions.clickMethod(superAdminPOM.getFiltersButton());
}
}
cagla88 marked this conversation as resolved.
Show resolved Hide resolved
Loading