@@ -0,0 +1,3132 @@
+/*%0A * Copyright 2017 Red Hat, Inc. and/or its affiliates.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.kie.wb.selenium.ui;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport org.assertj.core.api.Assertions;%0Aimport org.jboss.arquillian.graphene.findby.ByJQuery;%0Aimport org.jboss.arquillian.graphene.page.Page;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.kie.wb.selenium.model.KieSeleniumTest;%0Aimport org.kie.wb.selenium.model.persps.HomePerspective;%0Aimport org.kie.wb.selenium.util.Waits;%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.WebDriverException;%0A%0Apublic class StandalonePerspectivesIntegrationTest extends KieSeleniumTest %7B%0A%0A    @Page%0A    private HomePerspective home;%0A%0A    private final static String%0A            BASE_URL = System.getProperty(%22kie.wb.url%22),%0A            APP_CONTEXT = System.getProperty(%22app.name%22) + %22.jsp%22,%0A            STANDALONE_PARAMETER = %22?standalone=true%22,%0A            PERSPECTIVE_ID = %22&perspective=AuthoringPerspective%22,%0A            HEADER_PARAMETER = %22&header=AppNavBar%22,%0A            COMPLETE_URL = BASE_URL + %22/%22 + APP_CONTEXT + STANDALONE_PARAMETER + PERSPECTIVE_ID;%0A%0A    private static final By%0A            ELEMENT = ByJQuery.selector(%22h3:contains('Project Explorer')%22),%0A            HEADER = By.id(%22workbenchHeaderPanel%22);%0A%0A    @Before%0A    public void setUp() %7B%0A        login.getLoginPage();%0A        if (login.isDisplayed()) %7B%0A            home = login.loginDefaultUser();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testAuthoringPerspectiveWithoutHeader() %7B%0A        driver.get(COMPLETE_URL);%0A        verifyPerspectiveIsLoaded();%0A        verifyPresenceOfHeader(false);%0A    %7D%0A%0A    @Test%0A    public void testAuthoringPerspectiveWithHeader() %7B%0A        driver.get(COMPLETE_URL + HEADER_PARAMETER);%0A        verifyPerspectiveIsLoaded();%0A        verifyPresenceOfHeader(true);%0A    %7D%0A%0A    private void verifyPerspectiveIsLoaded() %7B%0A        try %7B%0A            Waits.elementPresent(ELEMENT, 10);%0A        %7D catch (WebDriverException exception) %7B%0A            Assertions.fail(%22The standalone perspective could not be loaded.%22, exception);%0A        %7D%0A    %7D%0A%0A    private void verifyPresenceOfHeader(boolean headerIncluded) %7B%0A        int%0A                actualHeaderCount = driver.findElements(HEADER).size(),%0A                expectedHeaderCount = headerIncluded ? 1 : 0;%0A%0A        String headerAssertionMessage = String.format(%22There should %25s be AppNavBar on the page.%22, headerIncluded ? %22%22 : %22NOT%22);%0A%0A        assertThat(actualHeaderCount)%0A                .as(headerAssertionMessage)%0A                .isEqualTo(expectedHeaderCount);%0A    %7D%0A%7D%0A

Add standalone Authoring Perspective test. (#626)