<commit_before><commit_msg>switch to testlink frame<commit_after>package com.seleniumtests.webpage;

import com.seleniumtests.controller.Assertion;
import com.seleniumtests.driver.web.element.Link;
import com.seleniumtests.driver.web.element.SelectList;
import com.seleniumtests.driver.web.element.WebPage;
import org.openqa.selenium.By;

/**
 * User: tbhadauria
 * Date: 10/2/13
 * Time: 6:26 PM
 */
public class AdminHomePage extends WebPage {

    private static SelectList documentationDropDown = new SelectList("Documentation drop down", By.name("docs"));

    public AdminHomePage() throws Exception{
        super(); // No check on page identification
    }

    private Link testProjectManagementLink = new Link("Test Project Management Link", By.linkText("Test Project Management"));
    private SelectList testProjectDropdown = new SelectList("Test Project Dropdown", By.name("testproject"));

    public AdminHomePage selectGivenTestProject(int index) {
        getDriver().switchTo().frame(getDriver().findElement(By.id("testlink"))); // switch to test link frame
        getDriver().switchTo().frame(getDriver().findElement(By.name("titlebar"))); // switch to title bar frame
        testProjectDropdown.selectByIndex(index);
        getDriver().switchTo().defaultContent();
        return this;
    }

    public AdminHomePage verifyDocumentationDropDown() {
        getDriver().switchTo().frame(getDriver().findElement(By.id("testlink")));
        getDriver().switchTo().frame(getDriver().findElement(By.name("mainframe")));
        Assertion.assertTrue(documentationDropDown.isDisplayed(), "Documentation drop down is missing");
        getDriver().switchTo().defaultContent();
        return this;
    }

    /**
     * this is a false test and would always fail
     */
    public AdminHomePage verifyDocumentationDropDownFail() {
        getDriver().switchTo().frame(getDriver().findElement(By.id("testlink")));
        getDriver().switchTo().frame(getDriver().findElement(By.name("mainframe")));
        Assertion.assertTrue(!documentationDropDown.isDisplayed(), "Documentation drop down is missing");
        getDriver().switchTo().defaultContent();
        return this;
    }



}

{'fraction_non_alphanumeric': 0.13027689514298685, 'fraction_numerical': 0.003631411711302769, 'mean_word_length': 4.247619047619048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3630512', 'n_tokens_mistral': 599, 'n_tokens_neox': 583, 'n_words': 122}