Skip to content

Commit

Permalink
Add functional tests xwikisas#16
Browse files Browse the repository at this point in the history
* Created the test modules and structures
  • Loading branch information
ChiuchiuSorin committed Nov 7, 2023
1 parent 33f1893 commit 14d2bba
Show file tree
Hide file tree
Showing 15 changed files with 399 additions and 107 deletions.
2 changes: 1 addition & 1 deletion application-admintools-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.139-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application-admintools-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion application-admintools-default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.139-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application-admintools-default</artifactId>
Expand Down
103 changes: 103 additions & 0 deletions application-admintools-test/application-admintools-test-docker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools-test</artifactId>
<version>1.0.139-SNAPSHOT</version>
</parent>
<artifactId>application-admintools-test-docker</artifactId>
<name>Admin Tools Application - Tests - Functional Docker Tests</name>
<packaging>jar</packaging>
<properties>
<!-- Functional tests are allowed to output content to the console -->
<xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip>
</properties>
<dependencies>
<!-- Dependencies for tested features. -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>application-admintools-ui</artifactId>
<version>${project.version}</version>
<type>xar</type>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-localization-rest-default</artifactId>
<version>${platform.version}</version>
<scope>runtime</scope>
</dependency>
<!-- Test only dependencies. -->
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-test-docker</artifactId>
<version>${platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>application-admintools-test-pageobjects</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/it</testSourceDirectory>
<plugins>
<!-- We need to explicitly include the failsafe plugin since it's not part of the default maven lifecycle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>clover</id>
<!-- Add the Clover JAR to the WAR so that it's available at runtime when XWiki executes.
It's needed because instrumented jars in the WAR will call Clover APIs at runtime when they execute. -->
<dependencies>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Tell the Docker-based test to activate the Clover profile so that the Clover JAR is added to
WEB-INF/lib -->
<xwiki.test.ui.profiles>clover</xwiki.test.ui.profiles>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package com.xwiki.admintools.test.ui;

import org.junit.jupiter.api.Test;
import org.xwiki.test.docker.junit5.TestConfiguration;
import org.xwiki.test.docker.junit5.TestReference;
import org.xwiki.test.docker.junit5.UITest;
import org.xwiki.test.docker.junit5.browser.Browser;
import org.xwiki.test.docker.junit5.database.Database;
import org.xwiki.test.docker.junit5.servletengine.ServletEngine;
import org.xwiki.test.ui.TestUtils;

@UITest(database = Database.MYSQL, databaseTag = "8", servletEngine = ServletEngine.TOMCAT, servletEngineTag = "8",
browser = Browser.CHROME)
class AdminToolsIT
{
@Test
void testTry(TestUtils testUtils, TestReference testReference,
TestConfiguration testConfiguration)
{
String test = testUtils.getDriver().getCurrentUrl();
System.out.println(test);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package com.xwiki.admintools.test.ui;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.xwiki.test.docker.junit5.UITest;

/**
* All UI tests for the Poll application.
*
* @version $Id$
* @since 2.2
*/
@UITest
class AllITs
{
@Nested
@DisplayName("Admin Tools UI")
class NestedAdminToolsIT extends AdminToolsIT
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools-test</artifactId>
<version>1.0.139-SNAPSHOT</version>
</parent>
<artifactId>application-admintools-test-pageobjects</artifactId>
<name>Admin Tools Application - Tests - Page Objects</name>
<dependencies>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-test-ui</artifactId>
<version>${platform.version}</version>
</dependency>
</dependencies>
</project>
52 changes: 52 additions & 0 deletions application-admintools-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools</artifactId>
<version>1.0.139-SNAPSHOT</version>
</parent>
<artifactId>application-admintools-test</artifactId>
<name>Admin Tools Application - Tests - Parent POM</name>
<packaging>pom</packaging>
<description>Admin Tools Application - Tests - Parent POM</description>
<properties>
<!-- Don't run CLIRR or Revapi in test modules since we don't care about backward compatibility for tests. -->
<xwiki.clirr.skip>true</xwiki.clirr.skip>
<xwiki.revapi.skip>true</xwiki.revapi.skip>
<!-- Don't run Checkstyle in test modules -->
<xwiki.checkstyle.skip>true</xwiki.checkstyle.skip>
</properties>
<modules>
<module>application-admintools-test-pageobjects</module>
</modules>
<profiles>
<profile>
<id>docker</id>
<modules>
<module>application-admintools-test-docker</module>
</modules>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion application-admintools-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.xwiki.admintools</groupId>
<artifactId>application-admintools</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.139-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application-admintools-ui</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version='1.1' encoding='UTF-8'?>
<?xml version="1.1" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -18,6 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.4" reference="AdminTools.Code.AdminToolsJS" locale="">
<web>AdminTools.Code</web>
<name>AdminToolsJS</name>
Expand Down Expand Up @@ -172,4 +174,4 @@
<use>onDemand</use>
</property>
</object>
</xwikidoc>
</xwikidoc>
Loading

0 comments on commit 14d2bba

Please sign in to comment.