<commit_before>/*
 * Copyright 2002-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.pivotal.cla.webdriver.pages;

import static org.assertj.core.api.Assertions.assertThat;

import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;

public class SignCclaPage extends BasePage {
	@FindBy(id = "corporate-cla")
	WebElement corporateCla;

	@FindBy(id = "breadcrumb-cla-link")
	WebElement claLink;

	@FindBy(id = "success")
	WebElement success;
	@FindBy(id = "pull-request")
	WebElement pullRequest;

	public SignCclaPage(WebDriver driver) {
		super(driver);
	}

	public String getCorporate() {
		return corporateCla.getText();
	}

	public void assertClaLink(String claName) {
		assertThat(claLink.getAttribute("href")).endsWith("/sign/"+claName);
	}

	public void assertPullRequestLink(String repositoryId, int pullRequestId) {
		String url = "https://github.com/" + repositoryId + "/pull/" + pullRequestId;
		assertThat(pullRequest.getAttribute("href")).isEqualTo(url);
	}

	public boolean isSigned() {
		try {
			return success.getText() != null;
		} catch(NoSuchElementException missing) {
			return false;
		}
	}

	public Form form() {
		Form form = new Form();
		PageFactory.initElements(getDriver(), form);
		return form;
	}

	public void assertAt() {
		System.out.println(getDriver().getPageSource());
		assertThat(getDriver().getTitle()).endsWith("- Sign CCLA");
	}

	public static String url(String cla) {<commit_msg>Remove System.out.println from test<commit_after>/*
 * Copyright 2002-2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.pivotal.cla.webdriver.pages;

import static org.assertj.core.api.Assertions.assertThat;

import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.Select;

public class SignCclaPage extends BasePage {
	@FindBy(id = "corporate-cla")
	WebElement corporateCla;

	@FindBy(id = "breadcrumb-cla-link")
	WebElement claLink;

	@FindBy(id = "success")
	WebElement success;
	@FindBy(id = "pull-request")
	WebElement pullRequest;

	public SignCclaPage(WebDriver driver) {
		super(driver);
	}

	public String getCorporate() {
		return corporateCla.getText();
	}

	public void assertClaLink(String claName) {
		assertThat(claLink.getAttribute("href")).endsWith("/sign/"+claName);
	}

	public void assertPullRequestLink(String repositoryId, int pullRequestId) {
		String url = "https://github.com/" + repositoryId + "/pull/" + pullRequestId;
		assertThat(pullRequest.getAttribute("href")).isEqualTo(url);
	}

	public boolean isSigned() {
		try {
			return success.getText() != null;
		} catch(NoSuchElementException missing) {
			return false;
		}
	}

	public Form form() {
		Form form = new Form();
		PageFactory.initElements(getDriver(), form);
		return form;
	}

	public void assertAt() {
		assertThat(getDriver().getTitle()).endsWith("- Sign CCLA");
	}

	public static String url(String cla) {
{'fraction_non_alphanumeric': 0.11251435132032148, 'fraction_numerical': 0.005510907003444317, 'mean_word_length': 4.627906976744186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6344998', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1324, 'n_words': 372}