<commit_before>package org.encuestame.selenium;

import junit.framework.TestCase;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

import java.util.concurrent.TimeUnit;

/**
 * Created by dmorales on 6/16/15.
 */
public class DashboardPageIT extends AbstractSelenium{

    /**
     *
     * @throws Exception
     */
    @Test
    public void testAddGadget() throws Exception {
        //*********  Create helper to Sign In
        loginEnme();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        //TODO: Define Id
        WebElement dashboard = driver.findElement(By.linkText("Dashboard"));
        assertNotNull(dashboard);
        dashboard.click();

        WebElement gadgetbutton = driver.findElement(By.id("add_gadget_button"));
        assertNotNull(gadgetbutton);
        gadgetbutton.click();
        // driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        //TODO: <div> with new-gadget-win id is repeated
       // WebElement gadgetwin = driver.findElement(By.id("new-gadget-win"));

    }

    /**
     * Test Change to Dashboard Layout-A
     */
    @Test
    public void testChangeLayoutA(){
        changeLayout();
        WebElement layouta = driver.findElement(By.id("layout-a"));
        assertNotNull(layouta);
       //
    }

    /**
     * Test Change to Dashboard Layout-BA
     */
    @Test
    public void testChangeLayoutBA(){
        changeLayout();
        WebElement layoutba = driver.findElement(By.id("layout-ba"));
        assertNotNull(layoutba);
    }

    /**
     * Test Change to Dashboard Layout-AB
     */
    @Test
    public void testChangeLayoutAA(){
        changeLayout();
        WebElement layoutaa = driver.findElement(By.id("layout-aa"));
        assertNotNull(layoutaa);
    }

    /**
     * Test Change to Dashboard Layout-AB
     */
    @Test
    public void testChangeLayoutAB(){
        changeLayout();
        WebElement layoutab = driver.findElement(By.id("layout-ab"));
        assertNotNull(layoutab);
    }

    @Test
    public void testDashboard() throws Exception {
        driver.get("http://localhost:8080/encuestame/home");
        //*********  Create helper to Sign In
        loginEnme();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        WebElement dashboard = driver.findElement(By.linkText("Dashboard"));

        Select droplist = new Select(driver.findElement(By.id("dijit_form_ComboBox_0")));
       // droplist.selectByVisibleText("English"); counter

    }

    @Test
    public void testNotification() throws Exception {
        driver.get("http://localhost:8080/encuestame/home");
        loginEnme();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        WebElement notification = driver.findElement(By.className("counter"));
        notification.click();

        WebElement allNotification = driver.findElement(By.className("final")).findElement(By.linkText("View All"));
       allNotification.click();
    }<commit_msg>New Test Cases for Dashboard page.<commit_after>package org.encuestame.selenium;

import junit.framework.TestCase;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

import java.util.concurrent.TimeUnit;

/**
 * Created by dmorales on 6/16/15.
 */
public class DashboardPageIT extends AbstractSelenium{

    /**
     *
     * @throws Exception
     */
    @Test
    public void testAddGadget() throws Exception {
        loginEnme();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        //TODO: Define Id
        WebElement dashboard = driver.findElement(By.linkText("Dashboard"));
        assertNotNull(dashboard);
        dashboard.click();

        WebElement gadgetbutton = driver.findElement(By.id("add_gadget_button"));
        assertNotNull(gadgetbutton);
        gadgetbutton.click();
        // driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        //TODO: <div> with new-gadget-win id is repeated
       // WebElement gadgetwin = driver.findElement(By.id("new-gadget-win"));

    }

    /**
     * Test Change to Dashboard Layout-A
     */
    @Test
    public void testChangeLayoutA(){
        changeLayout();
        WebElement layouta = driver.findElement(By.id("layout-a"));
        assertNotNull(layouta);
       //
    }

    /**
     * Test Change to Dashboard Layout-BA
     */
    @Test
    public void testChangeLayoutBA(){
        changeLayout();
        WebElement layoutba = driver.findElement(By.id("layout-ba"));
        assertNotNull(layoutba);
    }

    /**
     * Test Change to Dashboard Layout-AB
     */
    @Test
    public void testChangeLayoutAA(){
        changeLayout();
        WebElement layoutaa = driver.findElement(By.id("layout-aa"));
        assertNotNull(layoutaa);
    }

    /**
     * Test Change to Dashboard Layout-AB
     */
    @Test
    public void testChangeLayoutAB(){
        changeLayout();
        WebElement layoutab = driver.findElement(By.id("layout-ab"));
        assertNotNull(layoutab);
    }

    @Test
    public void testCreateDashboard(){
        loginEnme();
        WebElement dashboard = driver.findElement(By.linkText("Dashboard"));

        WebElement droplist = driver.findElement(By.id("new_dashboard"));
        assertNotNull(droplist);
        droplist.click();
        WebElement panelName= driver.findElement(By.id("panel_name"));
        assertNotNull(panelName);
        WebElement panelDesc= driver.findElement(By.id("panel_descr"));
        assertNotNull(panelDesc);
        // Sendkeys
        panelName.sendKeys("TweetpollDash");
        panelDesc.sendKeys("Tweetpoll Dashboard");
        //TODO: Define Button ID
        WebElement newButton= driver.findElement(By.id("new_dashboard_label"));
        assertNotNull(newButton);
    }

    /**
     * Test Select Dashboard.
     */
    @Test
    public void testSelectDashboard() {
        loginEnme();
        WebElement selector = driver.findElement(By.id("widget_change_dashboard"));
        assertNotNull(selector);
    }

    @Test
    public void testNotification() throws Exception {
        loginEnme();
        WebElement notification = driver.findElement(By.className("counter"));
        assertNotNull(notification);
        notification.click();
        WebElement allNotification = driver.findElement(By.className("final")).findElement(By.linkText("View All"));
        assertNotNull(allNotification);
        allNotification.click();
    }
{'fraction_non_alphanumeric': 0.12654787073391724, 'fraction_numerical': 0.004681365146481426, 'mean_word_length': 2.7524079320113315, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6813810', 'n_tokens_mistral': 1915, 'n_tokens_neox': 1873, 'n_words': 348}