-
Notifications
You must be signed in to change notification settings - Fork 11
Gradle Project Set #6
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
Open
osho-20
wants to merge
4
commits into
master
Choose a base branch
from
GradleSetup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,13 @@ hs_err_pid* | |
|
||
.idea | ||
.gauge | ||
|
||
gradle/ | ||
logs/ | ||
log/ | ||
bstack_build*/ | ||
build/ | ||
.gradle | ||
|
||
gauge_bin | ||
target/ | ||
browserstack.err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# ============================= | ||
# Set BrowserStack Credentials | ||
# ============================= | ||
# Add your BrowserStack userName and acccessKey here or set BROWSERSTACK_USERNAME and | ||
# BROWSERSTACK_ACCESS_KEY as env variables | ||
userName: YOUR_USERNAME | ||
accessKey: YOUR_ACCESS_KEY | ||
|
||
# ====================== | ||
# BrowserStack Reporting | ||
# ====================== | ||
# The following capabilities are used to set up reporting on BrowserStack: | ||
# Set 'projectName' to the name of your project. Example, Marketing Website | ||
projectName: BrowserStack Samples | ||
# Set `buildName` as the name of the job / testsuite being run | ||
buildName: browserstack build | ||
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to | ||
# buildName. Choose your buildIdentifier format from the available expressions: | ||
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution | ||
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30 | ||
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests | ||
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression} | ||
# Set `source` in the syntax `<fw-name>:sample-<branch-name>:<version-number> | ||
source: gauge:sample-main:v1.0 | ||
framework: gauge # <string> (Default: gauge) The framework you are using to run your tests | ||
# ======================================= | ||
# Platforms (Browsers / Devices to test) | ||
# ======================================= | ||
# Platforms object contains all the browser / device combinations you want to test on. | ||
# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate) | ||
platforms: | ||
- os: OS X | ||
osVersion: Big Sur | ||
browserName: Chrome | ||
browserVersion: latest | ||
- os: Windows | ||
osVersion: 10 | ||
browserName: Edge | ||
browserVersion: latest | ||
- deviceName: Samsung Galaxy S22 Ultra | ||
browserName: chrome # Try 'samsung' for Samsung browser | ||
osVersion: 12.0 | ||
|
||
# ======================= | ||
# Parallels per Platform | ||
# ======================= | ||
# The number of parallel threads to be used for each platform set. | ||
# BrowserStack's SDK runner will select the best strategy based on the configured value | ||
# | ||
# Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack | ||
# | ||
# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack | ||
parallelsPerPlatform: 1 | ||
|
||
# ========================================== | ||
# BrowserStack Local | ||
# (For localhost, staging/private websites) | ||
# ========================================== | ||
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet | ||
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction | ||
browserstackLocal: true # <boolean> (Default false) | ||
|
||
# browserStackLocalOptions: | ||
# Options to be passed to BrowserStack local in-case of advanced configurations | ||
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local. | ||
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel. | ||
# Entire list of arguments availabe here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections | ||
|
||
# =================== | ||
# Debugging features | ||
# =================== | ||
debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran | ||
networkLogs: false # <boolean> Set to true to enable HAR logs capturing | ||
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors) | ||
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java' | ||
id 'org.gauge' version '1.8.2' | ||
id 'com.browserstack.gradle-sdk' version '1.1.2' | ||
} | ||
|
||
group 'Gradle_example' | ||
version '1.0-SNAPSHOT' | ||
|
||
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
configurations.all { | ||
resolutionStrategy { | ||
force 'com.google.guava:guava:30.1.1-jre' | ||
|
||
eachDependency { details -> | ||
if (details.requested.group == 'com.google.guava') { | ||
if (details.requested.name == 'guava') { | ||
details.useVersion '30.1.1-jre' | ||
details.because 'Compatibility with Java 11 and all dependencies' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation('com.google.guava:guava:30.1.1-jre') { | ||
capabilities { | ||
requireCapability('com.google.guava:guava') | ||
} | ||
} | ||
implementation 'com.thoughtworks.gauge:gauge-java:0.12.0' | ||
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.20.2' | ||
implementation 'com.browserstack:browserstack-local-java:1.0.6' | ||
implementation 'org.seleniumhq.selenium:selenium-java:4.0.0' | ||
testImplementation 'junit:junit:4.13.2' | ||
implementation 'com.browserstack:browserstack-java-sdk:latest.release' | ||
|
||
} | ||
|
||
gauge { | ||
specsDir = 'sample-specs/' | ||
additionalFlags = '--verbose' | ||
} | ||
|
||
// Task to run a single spec (add-to-cart only) | ||
task runSingleSpec(type: com.thoughtworks.gauge.gradle.GaugeTask) { | ||
group = 'verification' | ||
description = 'Run only the add-to-cart spec file using Gauge' | ||
dependsOn 'testClasses' | ||
|
||
doFirst { | ||
project.gauge.specsDir = 'sample-specs/add-to-cart.spec' | ||
} | ||
|
||
doLast { | ||
project.gauge.specsDir = 'sample-specs/' | ||
} | ||
} | ||
|
||
// Task to run a single spec (add-to-cart only) | ||
task runAllSpec(type: com.thoughtworks.gauge.gradle.GaugeTask) { | ||
group = 'verification' | ||
description = 'Run only the add-to-cart spec file using Gauge' | ||
dependsOn 'testClasses' | ||
|
||
doFirst { | ||
project.gauge.specsDir = 'sample-specs/' | ||
} | ||
|
||
doLast { | ||
project.gauge.specsDir = 'sample-specs/' | ||
} | ||
} | ||
|
||
// Task to run a single spec (add-to-cart only) | ||
task runLocalSpec(type: com.thoughtworks.gauge.gradle.GaugeTask) { | ||
group = 'verification' | ||
description = 'Run only the add-to-cart spec file using Gauge' | ||
dependsOn 'testClasses' | ||
|
||
doFirst { | ||
project.gauge.specsDir = 'sample-local-specs/' | ||
} | ||
|
||
doLast { | ||
project.gauge.specsDir = 'sample-specs/' | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's modify the instructions to run with gradle wrapper command only.