Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for GitHub Actions / Bumped Dependencies #7

Merged
merged 5 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
9 changes: 9 additions & 0 deletions .github/scripts/InstallChrome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
sudo apt-get install xvfb

sudo apt-get install unzip

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt install google-chrome-stable
19 changes: 19 additions & 0 deletions .github/scripts/downloadDriver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

sudo apt-get install xvfb

sudo apt-get install unzip

cd "$(pwd)$1" &&

ROOT_DIR=$(pwd)
mkdir "temp" &&
cd "temp" &&
curl -L -k --output driver.zip https://www.nuget.org/api/v2/package/Selenium.WebDriver.ChromeDriver/ --ssl-no-revoke &&
unzip driver.zip &&
cd driver/linux64 &&
ls &&
chmod +x chromedriver &&
sudo mv -f chromedriver "$ROOT_DIR" &&
cd ../../../ &&
rm -rf temp
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: UI and API Tests

on:
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Remove Chrome
run: sudo apt purge google-chrome-stable
- name: Remove default Chromium
run: sudo apt purge chromium-browser

- name: Install Google Chrome # Using shell script to install Google Chrome
run: |
chmod +x ./.github/scripts/InstallChrome.sh
./.github/scripts/InstallChrome.sh

- name: Install Chrome Driver # Using shell script to install Chrome Driver
run: |
chmod +x ./.github/scripts/downloadDriver.sh
./.github/scripts/downloadDriver.sh "/wikipedia/src/test/resources/drivers"

- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional

- name: Test
run: mvn clean install -DactiveProfile=headless-github
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ test-output/
*.iml
.allure

/common/src/main/resources/drivers/chromedriver.exe
/common/src/main/resources/drivers/geckodriver.exe
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Spring Cucumber Junit Parallel Test Harness

[![Build Status](https://travis-ci.com/cmccarthyIrl/spring-cucumber-junit-test-harness.svg?branch=master)](https://travis-ci.com/cmccarthyIrl/spring-cucumber-junit-test-harness) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/6e4bd0bef1b5467aaaed6bc70a8ca2ae)](https://www.codacy.com/gh/cmccarthyIrl/spring-cucumber-junit-test-harness/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cmccarthyIrl/spring-cucumber-junit-test-harness&utm_campaign=Badge_Grade)

[![test](https://github.com/cmccarthyIrl/spring-cucumber-junit-parallel-test-harness/actions/workflows/test.yml/badge.svg)](https://github.com/cmccarthyIrl/spring-cucumber-junit-parallel-test-harness/actions/workflows/test.yml)
# Index

<table>
Expand Down Expand Up @@ -122,8 +121,8 @@ Selenium `<dependencies>`:
# Quickstart

- [Intellij IDE](https://www.jetbrains.com/idea/) - `Recommended`
- [Java JDK 11](https://jdk.java.net/java-se-ri/11)
- [Apache Maven 3.6.3](https://maven.apache.org/docs/3.6.3/release-notes.html)
- [Java JDK 17](https://jdk.java.net/java-se-ri/11)
- [Apache Maven](https://maven.apache.org/docs/3.6.3/release-notes.html)

# JUnit 5

Expand Down
30 changes: 9 additions & 21 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,15 @@
<relativePath>../pom.xml</relativePath>
</parent>

<build>
<plugins>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<configuration>
<includes>
<include>**/*.xml</include>
<include>**/junit-platform.properties</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<version>1.7.0</version>
</plugin>
</plugins>
</build>
<!-- <build>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-resources-plugin</artifactId>-->
<!-- <version>3.3.0</version>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
<modelVersion>4.0.0</modelVersion>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class ApplicationProperties {
private String wikipediaUrl;
@Value("${browser}")
private String browser;
@Value("${cloud.url}")
private String cloudUrl;

public String getWeatherAppUrl() {
return weatherAppUrl;
Expand All @@ -36,4 +38,8 @@ public String getBrowser() {
public void setBrowser(String browser) {
this.browser = browser;
}

public String getCloudUrl() {
return cloudUrl;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
weather.url.value=http://api.openweathermap.org/data/2.5/weather
wikipedia.url.value=https://www.wikipedia.org/
browser=chrome
gridUrl=http://selenium_hub:4444/wd/hub
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
weather.url.value=http://api.openweathermap.org/data/2.5/weather
wikipedia.url.value=https://www.wikipedia.org/
browser=chrome
1 change: 1 addition & 0 deletions common/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
weather.url.value=http://api.openweathermap.org/data/2.5/weather
wikipedia.url.value=https://www.wikipedia.org/
browser=chrome
Empty file.
Binary file removed common/src/main/resources/drivers/chromedriver
Binary file not shown.
Binary file removed common/src/main/resources/drivers/geckodriver
Binary file not shown.
36 changes: 21 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>3.0.4</version>
<version>3.3.3</version>
<relativePath/>
</parent>

<properties>
<activeProfile>prod</activeProfile>
<activeProfile>headless-github</activeProfile>
<compiler.plugin.version>3.8.1</compiler.plugin.version>
<java.version>17</java.version>
<resource.plugin.version>3.1.0</resource.plugin.version>
<junit.platform.suite.version>1.11.0</junit.platform.suite.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<restassured.version>5.2.0</restassured.version>
Expand Down Expand Up @@ -106,20 +108,14 @@
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.0.4</version>
<version>3.3.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -130,7 +126,7 @@
<dependency>
<artifactId>json</artifactId>
<groupId>org.json</groupId>
<version>20220924</version>
<version>20231013</version>
</dependency>

<!-- Cucumber dependencies-->
Expand All @@ -154,7 +150,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.9.2</version>
<version>${junit.platform.suite.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -172,15 +168,14 @@
<dependency>
<groupId>tech.grasshopper</groupId>
<artifactId>extentreports-cucumber7-adapter</artifactId>
<version>1.9.0</version>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber7-jvm</artifactId>
<version>2.21.0</version>
</dependency>


<!--test dependencies -->
<dependency>
<artifactId>commons-io</artifactId>
Expand All @@ -195,10 +190,9 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<version>1.9.2</version>
<version>${junit.platform.suite.version}</version>
</dependency>


<!--spring dependencies-->
<dependency>
<artifactId>spring-rabbit</artifactId>
Expand Down Expand Up @@ -253,6 +247,18 @@
<activatedProperties>dev</activatedProperties>
</properties>
</profile>
<profile>
<id>cloud-provider</id>
<properties>
<activatedProperties>cloud-provider</activatedProperties>
</properties>
</profile>
<profile>
<id>headless-github</id>
<properties>
<activatedProperties>headless-github</activatedProperties>
</properties>
</profile>
</profiles>

</project>
Loading