Skip to content
Snippets Groups Projects
Commit ab4e2ec0 authored by buczekp's avatar buczekp
Browse files

test: check hidding of tabs

SVN: 18207
parent 2aa855a3
No related merge requests found
...@@ -24,11 +24,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU ...@@ -24,11 +24,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU
* *
* @author Piotr Buczek * @author Piotr Buczek
*/ */
public final class ActivateTab extends AbstractDefaultTestCommand public class ActivateTab extends AbstractDefaultTestCommand
{ {
private final String tabPanelId; protected final String tabPanelId;
private final String tabItemId; protected final String tabItemId;
public ActivateTab(final String tabPanelId, final String tabItemId) public ActivateTab(final String tabPanelId, final String tabItemId)
{ {
...@@ -40,7 +40,7 @@ public final class ActivateTab extends AbstractDefaultTestCommand ...@@ -40,7 +40,7 @@ public final class ActivateTab extends AbstractDefaultTestCommand
// AbstractDefaultTestCommand // AbstractDefaultTestCommand
// //
public final void execute() public void execute()
{ {
GWTTestUtil.selectTabItemWithId(tabPanelId, tabItemId); GWTTestUtil.selectTabItemWithId(tabPanelId, tabItemId);
} }
......
/*
* Copyright 2008 ETH Zuerich, CISD
*
* 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 ch.systemsx.cisd.openbis.generic.client.web.client.application.ui;
import junit.framework.AssertionFailedError;
import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand;
/**
* A {@link AbstractDefaultTestCommand} extension that expects tab to not exist.
*
* @author Piotr Buczek
*/
public final class CheckTabNotExists extends ActivateTab
{
public CheckTabNotExists(final String tabPanelId, final String tabItemId)
{
super(tabPanelId, tabItemId);
}
//
// AbstractDefaultTestCommand
//
@Override
public final void execute()
{
try
{
super.execute();
fail("Expected AssertionFailedError because tab '" + tabItemId + "' shouldn't exist");
} catch (AssertionFailedError e)
{
assertTrue(
"Unexpected exception message " + e.getMessage(),
e.getMessage().startsWith(
"No tab item with id '" + tabItemId
+ "' could be found in panel with following tabs"));
}
}
}
...@@ -26,6 +26,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent ...@@ -26,6 +26,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDisplayTypeIDGenerator;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.CheckTabNotExists;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Login; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Login;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.AttachmentColDefKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.AttachmentColDefKind;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.DataSetRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.DataSetRow;
...@@ -80,6 +81,12 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase ...@@ -80,6 +81,12 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase
private static final String EXP_X_PERM_ID = "200811050937246-1031"; private static final String EXP_X_PERM_ID = "200811050937246-1031";
private static final String EXP_TEST_1 = "EXP-TEST-1";
private static final String EXP_TEST_1_ID = "/CISD/NEMO/EXP-TEST-1";
private static final String EXP_TEST_1_PERM_ID = "200902091239077-1033";
private static final String A_SIMPLE_EXPERIMENT = "A simple experiment"; private static final String A_SIMPLE_EXPERIMENT = "A simple experiment";
private static final String DOE_JOHN = "Doe, John"; private static final String DOE_JOHN = "Doe, John";
...@@ -88,6 +95,8 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase ...@@ -88,6 +95,8 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase
private static final String SIRNA_HCS = "SIRNA_HCS"; private static final String SIRNA_HCS = "SIRNA_HCS";
private static final String COMPOUND_HCS = "COMPOUND_HCS";
private static final String NEMO = "NEMO (CISD)"; private static final String NEMO = "NEMO (CISD)";
private static final String EXP1 = "EXP1"; private static final String EXP1 = "EXP1";
...@@ -188,6 +197,23 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase ...@@ -188,6 +197,23 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase
launchTest(); launchTest();
} }
public final void testWebConfigurationHidingAttachmentSection()
{
prepareShowExperiment(NEMO, COMPOUND_HCS, EXP_TEST_1);
final CheckExperiment checkExperiment = new CheckExperiment();
checkExperiment.property("Experiment").asString(EXP_TEST_1_ID);
checkExperiment.property("PermID").matchingPattern(
".*<a href=\".*permId=" + EXP_TEST_1_PERM_ID + ".*>" + EXP_TEST_1_PERM_ID
+ "</a>.*");
checkExperiment.property("Experiment Type").asCode(COMPOUND_HCS);
remoteConsole.prepare(checkExperiment);
remoteConsole.prepare(new CheckTabNotExists(createSectionsTabPanelId(),
createSectionId(DisplayTypeIDGenerator.ATTACHMENT_SECTION)));
launchTest();
}
@DoNotRunWith(Platform.HtmlUnit) @DoNotRunWith(Platform.HtmlUnit)
public final void testListOfAttachments() public final void testListOfAttachments()
{ {
...@@ -260,8 +286,9 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase ...@@ -260,8 +286,9 @@ public class GenericExperimentViewerTest extends AbstractGWTTestCase
final CheckTableCommand datasetTable = final CheckTableCommand datasetTable =
checkExperiment.createDataSetTableCheck().expectedSize(2); checkExperiment.createDataSetTableCheck().expectedSize(2);
datasetTable.expectedRow(new DataSetRow("20081105092159188-3").valid().derived()); datasetTable.expectedRow(new DataSetRow("20081105092159188-3").valid().derived());
datasetTable.expectedRow(new DataSetRow("20081105092158673-1").invalid().withSample( datasetTable.expectedRow(new DataSetRow("20081105092158673-1").invalid()
"CISD:/CISD/3VCP1").withSampleType("CELL_PLATE").notDerived().withIsComplete(null)); .withSample("CISD:/CISD/3VCP1").withSampleType("CELL_PLATE").notDerived()
.withIsComplete(null));
datasetTable.expectedColumnsNumber(25); datasetTable.expectedColumnsNumber(25);
final String commentColIdent = GridTestUtils.getPropertyColumnIdentifier("COMMENT", false); final String commentColIdent = GridTestUtils.getPropertyColumnIdentifier("COMMENT", false);
datasetTable.expectedColumnHidden(commentColIdent, true); datasetTable.expectedColumnHidden(commentColIdent, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment