/*
 * Copyright 2008-2012 Microarray Informatics Team, EMBL-European Bioinformatics Institute
 *
 * 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.
 *
 *
 * For further details of the Gene Expression Atlas project, including source code,
 * downloads and documentation, please see:
 *
 * http://gxa.github.com/gxa
 */

package uk.ac.ebi.atlas.acceptance.selenium.tests.heatmaptable;

import org.junit.Test;
import uk.ac.ebi.atlas.acceptance.selenium.pages.HeatmapTablePage;
import uk.ac.ebi.atlas.acceptance.selenium.utils.SeleniumFixture;

import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertThat;

public class Cutoff05AndGenePropertyIT extends SeleniumFixture {

    protected HeatmapTablePage subject;

    public void getStartingPage() {
//
    }

    @Test
    public void verifyResultOnSinglePropertyQuery() {
        subject = new HeatmapTablePage(driver, "geneQuery=regulation&cutoff=0.5");
        subject.get();
        assertThat(subject.getGeneCount().contains("62"), is(true));
    }

    @Test
    public void verifyResultOnMultiplePropertyQuery() {
        subject = new HeatmapTablePage(driver, "geneQuery=regulation+%22protein+binding%22&cutoff=0.5");
        subject.get();
        assertThat(subject.getGeneCount(), containsString("82"));
    }

    @Test
    public void verifyResultOnMultiplePropertyAndOrganismPartQuery() {
        subject = new HeatmapTablePage(driver, "geneQuery=regulation+%22protein+binding%22&" +
                "queryFactorValues=skeletal+muscle&queryFactorValues=thyroid&_queryFactorValues=2&cutoff=0.5");
        subject.get();
        assertThat(subject.getGeneCount().contains("67"), is(true));
        subject.clickDisplayLevelsButton();
        assertThat(subject.getFirstGeneProfile(), contains("9", "10", "5", "8", "18", "5", "30", "4", "1", "10", "15", "9", "103", "8", "56", "0.7"));
    }

}

@@ -1502,26 +1502,16 @@
 neQuery=
-regulation
 &cutoff=
@@ -1581,25 +1581,26 @@
 eCount()
-.
+, 
 contains
 (%2262%22), 
@@ -1595,23 +1595,23 @@
 ains
-(%2262%22), is(true
+String(%22of 268%22
 ));%0A
@@ -1745,40 +1745,8 @@
 ery=
-regulation+%2522protein+binding%2522
 &cut
@@ -1842,10 +1842,14 @@
 ng(%22
+of 26
 8
-2
 %22));
@@ -1999,62 +1999,9 @@
 ery=
-regulation+%2522protein+binding%2522&%22 +%0A                %22
+&
 quer
@@ -2155,25 +2155,26 @@
 eCount()
-.
+, 
 contains
 (%2267%22), 
@@ -2169,23 +2169,23 @@
 ains
-(%2267%22), is(true
+String(%22of 169%22
 ));%0A
@@ -2292,94 +2292,93 @@
 ns(%22
-9
 %22, %2210
+688
 %22, %22
-5
 %22, %22
-8
 %22, %22
-18
 %22, %22
-5
 %22, %22
-30
 %22, %22
-4
 %22, %22
-1%22, %2210%22, %2215
+6899%22, %227811%22, %226720
 %22, %22
-9
 %22, %22
-103
 %22, %22
-8
 %22, %22
-56%22, %220.7
+8660%22, %224149
 %22));

test was failing because of dependence with solr indexes, removed it