Skip to content

Commit

Permalink
Se modifica los selectores y se ajusta con respecto a eso la interact…
Browse files Browse the repository at this point in the history
…ion SelectDropDownButton
  • Loading branch information
cedaniel200 committed Jun 4, 2020
1 parent 96dbcd7 commit c40f0de
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static SelectDropDownButton addGitIgnoreFilteringBy(GitIgnore valueFilter
public static SelectDropDownButton addLicenseFilteringBy(License valueFilter) {
return instrumented(SelectDropDownButton.class, ADD_LICENSE,
FILTER_LICENSE, valueFilter.toString(),
SELECTOR_FORMAT_LICENSE);
String.format(SELECTOR_FORMAT_LICENSE, valueFilter));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.com.yourcompany.certification.nameproject.tasks;

import co.com.yourcompany.certification.nameproject.exceptions.RepositoryAlreadyExistsException;
import co.com.yourcompany.certification.nameproject.exceptions.RepositoryAlreadyExistsError;
import co.com.yourcompany.certification.nameproject.exceptions.RepositoryModelCreationException;
import co.com.yourcompany.certification.nameproject.interactions.SelectDropDownButton;
import co.com.yourcompany.certification.nameproject.model.Repository;
Expand All @@ -13,10 +13,10 @@
import net.serenitybdd.screenplay.actions.Scroll;
import net.serenitybdd.screenplay.conditions.Check;

import static co.com.yourcompany.certification.nameproject.exceptions.RepositoryAlreadyExistsException.withMessageBy;
import static co.com.yourcompany.certification.nameproject.exceptions.RepositoryAlreadyExistsError.withMessageBy;
import static co.com.yourcompany.certification.nameproject.model.enumerables.GitIgnore.NONE;
import static co.com.yourcompany.certification.nameproject.userinterface.CreateNewRepositoryPage.*;
import static co.com.yourcompany.certification.nameproject.userinterface.GitHubHomePage.NEW_REPOSITORY;
import static co.com.yourcompany.certification.nameproject.userinterface.UserGitHubHomePage.NEW_REPOSITORY;
import static co.com.yourcompany.certification.nameproject.util.validations.Validations.isNotEmptyOrNull;
import static net.serenitybdd.screenplay.GivenWhenThen.seeThat;
import static net.serenitybdd.screenplay.Tasks.instrumented;
Expand All @@ -39,7 +39,7 @@ public <T extends Actor> void performAs(T actor) {
);

actor.should(seeThat(the(MESSAGE_REPOSITORY_ALREADY_EXISTS), isNotVisible())
.orComplainWith(RepositoryAlreadyExistsException.class,
.orComplainWith(RepositoryAlreadyExistsError.class,
withMessageBy(repository.name())));

actor.attemptsTo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,28 @@ public class CreateNewRepositoryPage {

public static final Target ADD_GITIGNORE = Target
.the("Add .gitignore")
.locatedBy("//*[@id=\"new_repository\"]/div[3]/div[4]/ul/li[1]/details/summary");
.locatedBy(".my-3 > .select-menu > .btn");

public static final Target FILTER_GITIGNORE = Target
.the("filter of the gitignore").located(By.id("context-ignore-filter-field"));

public static final String SELECTOR_FORMAT_GITIGNORE = ".filterable-active";

public static final Target ADD_LICENSE = Target
.the("Add a license")
.locatedBy("//*[@id=\"new_repository\"]/div[3]/div[4]/ul/li[2]/details/summary");

public static final Target FILTER_GITIGNORE = Target
.the("filter of the gitignore")
.located(By.id("context-ignore-filter-field"));
.locatedBy(".btn > .text-normal");

public static final Target FILTER_LICENSE = Target
.the("filter of the license")
.locatedBy("//*[@id=\"repo-new-license-details\"]/div/div/filter-input/input");

public static final String SELECTOR_FORMAT_GITIGNORE = "#new_repository > div.js-with-permission-fields > div.js-repository-auto-init-options > ul > li:nth-child(1) > " +
"details > details-menu > div.select-menu-list > div.filterable-active";
.locatedBy(".SelectMenu-filter > .width-full");

public static final String SELECTOR_FORMAT_LICENSE = "//label[@aria-selected='true']";
public static final String SELECTOR_FORMAT_LICENSE = "//div[@class=\"SelectMenu-list\"]//span[contains(text(), '%s')]//ancestor::label";

public static final Target CREATE_REPOSITORY = Target
.the("Create repository")
.locatedBy("//*[@id=\"new_repository\"]/div[3]/button");

public static final Target MESSAGE_REPOSITORY_ALREADY_EXISTS = Target
.the("Error message")
.locatedBy("//*[@id=\"new_repository\"]/div[2]/auto-check/dl/dd[2]");
.locatedBy(".error > strong");
}

0 comments on commit c40f0de

Please sign in to comment.