Skip to content

Commit ed75141

Browse files
committed
Initial commit
1 parent 60f7d60 commit ed75141

File tree

262 files changed

+25094
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+25094
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
#
2+
# Inputs (Action Inputs) : kebab-case (all lowercase letters with hyphens)
3+
# Outputs (Action Outputs): camelCase (lowercase first letter with uppercase subsequent words)
4+
# Environment Variables : UPPERCASE_WITH_UNDERSCORES
5+
# Job Names : PascalCase or Title Case
6+
# Step IDs : snake_case or kebab-case
7+
#
8+
name: Build, Test & Release
9+
10+
# Permissions for the workflow
11+
permissions:
12+
contents: write
13+
checks: write
14+
pull-requests: write
15+
statuses: write
16+
17+
# Trigger workflow on push to the main branch
18+
on:
19+
push:
20+
branches:
21+
- main
22+
23+
env:
24+
#
25+
# Build and release settings
26+
ARTIFACT_TYPE : 'Production'
27+
DOTNET_VERSION : '8.0.x'
28+
BINARIES_DIRECTORY : ${{ github.workspace }}/binaries
29+
BUILD_CONFIGURATION : 'Release'
30+
SOLUTION_NAME : 'G4'
31+
STAGE_DIRECTORY : ${{ github.workspace }}/artifact_staging
32+
#
33+
# Publish settings
34+
NUGET_API_KEY : ${{ secrets.NUGET_PUBLIC_KEY }}
35+
NUGET_SOURCE : ${{ vars.NUGET_PUBLIC_SOURCE }}
36+
#
37+
# Test settings
38+
BROWSERSTACK_API_KEY: ${{ secrets.BROWSERSTACK_API_KEY }}
39+
BROWSERSTACK_USER : ${{ secrets.BROWSERSTACK_USER }}
40+
G4_API_KEY : ${{ secrets.G4_API_KEY }}
41+
GRID_ENDPOINT : ${{ secrets.GRID_ENDPOINT }}
42+
RUN_SETTINGS_FILE : 'Default.runsettings'
43+
TEST_WORKERS : '5'
44+
45+
# Default settings for all run steps
46+
defaults:
47+
run:
48+
working-directory: src
49+
50+
jobs:
51+
NewVersion:
52+
name: New Version
53+
runs-on: ubuntu-latest
54+
outputs:
55+
buildVersion: ${{ steps.parse-version.outputs.version }}
56+
validVersion: ${{ steps.validate-version.outputs.valid }}
57+
58+
steps:
59+
- name: Checkout Repository
60+
uses: actions/checkout@v4
61+
62+
- name: Parse Build Version for GitHub Tag
63+
id: parse-version
64+
shell: pwsh
65+
run: echo "version=$(Get-Date -UFormat '%Y.%m.%d').${{ github.run_number }}" >> $env:GITHUB_OUTPUT
66+
67+
- name: Validate Version ${{ steps.parse-version.outputs.version }}
68+
id: validate-version
69+
shell: pwsh
70+
run: |
71+
$version = "${{ steps.parse-version.outputs.version }}"
72+
echo "valid=$($version -match '^\d+(\.\d+){3}$')" >> $env:GITHUB_OUTPUT
73+
74+
NewBuild:
75+
name: Restore & Build
76+
runs-on: ubuntu-latest
77+
if: ${{ needs.NewVersion.result == 'success' && needs.NewVersion.outputs.validVersion == 'True' }}
78+
needs:
79+
- NewVersion
80+
81+
env:
82+
BUILD_VERSION: ${{ needs.NewVersion.outputs.buildVersion }}
83+
84+
steps:
85+
- name: Checkout Repository
86+
uses: actions/checkout@v4
87+
88+
- name: Setup .NET
89+
uses: actions/setup-dotnet@v4
90+
with:
91+
dotnet-version: "${{ env.DOTNET_VERSION }}"
92+
93+
- name: Restore Dependencies
94+
shell: pwsh
95+
run: dotnet restore
96+
97+
- name: Build ${{ env.SOLUTION_NAME }} v${{ env.BUILD_VERSION }}
98+
shell: pwsh
99+
run: dotnet build
100+
101+
PublishNugetPackages:
102+
name: Publish & Push NuGet Packages v${{ needs.NewVersion.outputs.buildVersion }}
103+
runs-on: ubuntu-latest
104+
if: ${{ needs.NewBuild.result == 'success' }}
105+
needs:
106+
- NewVersion
107+
- NewBuild
108+
109+
defaults:
110+
run:
111+
working-directory: ${{ github.workspace }}
112+
113+
env:
114+
BUILD_VERSION: ${{ needs.NewVersion.outputs.buildVersion }}
115+
116+
steps:
117+
- name: Checkout Repository
118+
uses: actions/checkout@v4
119+
120+
- name: New Packages v${{ env.BUILD_VERSION }}
121+
shell: pwsh
122+
run: dotnet pack -o ${{ env.STAGE_DIRECTORY }} -c ${{ env.BUILD_CONFIGURATION }} /p:Version=${{ env.BUILD_VERSION }}
123+
working-directory: src
124+
125+
- name: Publish Build Artifacts to NuGet Feed
126+
shell: pwsh
127+
run: |
128+
dotnet nuget push "${{ env.STAGE_DIRECTORY }}/*.nupkg" --api-key ${{ env.NUGET_API_KEY }} --source ${{ env.NUGET_SOURCE }}
129+
130+
- name: Upload Build Artifacts
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: nuget-packages-drop-v${{ env.BUILD_VERSION }}
134+
path: ${{ env.STAGE_DIRECTORY }}/*.nupkg
135+
136+
NewRelease:
137+
name: New GitHub Release Version ${{ needs.NewVersion.outputs.buildVersion }}
138+
runs-on: ubuntu-latest
139+
if: ${{ needs.NewVersion.result == 'success' && needs.NewVersion.outputs.validVersion == 'True' && needs.PublishNugetPackages.result == 'success' }}
140+
needs:
141+
- NewVersion
142+
- PublishNugetPackages
143+
144+
env:
145+
BUILD_VERSION: ${{ needs.NewVersion.outputs.buildVersion }}
146+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147+
148+
steps:
149+
- name: Checkout repository
150+
uses: actions/checkout@v4
151+
152+
- name: Download Build Artifacts
153+
uses: actions/download-artifact@v4
154+
with:
155+
path: ${{ env.STAGE_DIRECTORY }}
156+
157+
- name: List Downloaded Files
158+
run: |
159+
ls -R ${{ env.STAGE_DIRECTORY }}
160+
161+
- name: Create GitHub Release & Tag v${{ env.BUILD_VERSION }}
162+
uses: softprops/action-gh-release@v2
163+
with:
164+
files: |
165+
**/*.zip
166+
**/*.nupkg
167+
tag_name: v${{ env.BUILD_VERSION }}
168+
name: ${{ env.ARTIFACT_TYPE }} v${{ env.BUILD_VERSION }}
169+
generate_release_notes: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*.user
1010
*.userosscache
1111
*.sln.docstates
12+
Local.runsettings
1213

1314
# User-specific files (MonoDevelop/Xamarin Studio)
1415
*.userprefs
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# G4.WebDriver.Remote.Android
2+
3+
[![NuGet](https://img.shields.io/nuget/v/G4.WebDriver.Remote.Android?logo=nuget&logoColor=959da5&label=NuGet&labelColor=24292f)](https://www.nuget.org/packages/G4.WebDriver.Remote.Android)
4+
[![Build, Test & Release](https://github.com/g4-api/g4-web-driver-client/actions/workflows/release-pipeline.yml/badge.svg)](https://github.com/g4-api/g4-web-driver-client/actions/workflows/release-pipeline.yml)
5+
6+
## Description
7+
8+
`G4.WebDriver.Remote.Android` is a foundational library for interacting with Android devices through the Appium WebDriver. This library facilitates seamless communication with Appium WebDriver, enabling effective automation within the G4™ ecosystem and other automation environments. Offering versatility, it provides a reliable interface for remote communication with Android devices.
9+
10+
## Features
11+
12+
- **Remote Android Device Automation**
13+
Interact with Android devices remotely using the Appium WebDriver.
14+
15+
- **Seamless Communication with Appium**
16+
Leverage the capabilities of Appium to enable effective automation on Android platforms.
17+
18+
- **Versatile & Reliable**
19+
Provides a stable and standardized interface for remote interaction with Android devices.
20+
21+
- **Modern .NET Support**
22+
Built on .NET 8.0 to harness the latest platform features and performance improvements.
23+
24+
## Installation
25+
26+
You can install the `G4.WebDriver.Remote.Android` package using one of the following methods:
27+
28+
**Using the .NET CLI:**
29+
30+
```bash
31+
dotnet add package G4.WebDriver.Remote.Android
32+
```
33+
34+
**Using the NuGet Package Manager Console:**
35+
36+
```powershell
37+
Install-Package G4.WebDriver.Remote.Android
38+
```
39+
40+
## Getting Started (C# Example)
41+
42+
Below is an example demonstrating how to use the `RemoteAndroidDriver` with Appium options to automate an Android device in a C# project:
43+
44+
```csharp
45+
using G4.WebDriver.Remote.Android;
46+
using G4.WebDriver.Remote.Appium.Models;
47+
48+
class Program
49+
{
50+
static void Main()
51+
{
52+
var options = new AndroidOptions();
53+
54+
options.AddCapabilities(capabilities: new Dictionary<string, object>
55+
{
56+
["platformName"] = "Android",
57+
["platformVersion"] = "11.0",
58+
["deviceName"] = "Android Emulator",
59+
["appium:appPackage"] = "com.android.calculator2",
60+
["appium:appActivity"] = "com.android.calculator2.Calculator"
61+
});
62+
63+
var driver = new AndroidDriver(new Uri("http://127.0.0.1:4723/wd/hub"), options);
64+
65+
// Locate and click the "2" digit button
66+
var digit2 = driver.FindElement(MobileDeviceBy.MobileElementResourceId("com.android.calculator2:id/digit_2"));
67+
digit2.Click();
68+
69+
// Locate and click the addition operator button ("+")
70+
var plusOperator = driver.FindElement(MobileDeviceBy.MobileElementResourceId("com.android.calculator2:id/op_add"));
71+
plusOperator.Click();
72+
73+
// Locate and click the "3" digit button
74+
var digit3 = driver.FindElement(MobileDeviceBy.MobileElementResourceId("com.android.calculator2:id/digit_3"));
75+
digit3.Click();
76+
77+
// Locate and click the equals operator button ("=")
78+
var equalsOperator = driver.FindElement(MobileDeviceBy.MobileElementResourceId("com.android.calculator2:id/eq"));
79+
equalsOperator.Click();
80+
81+
// Optionally, retrieve the result displayed on the calculator
82+
var resultElement = driver.FindElement(MobileDeviceBy.MobileElementResourceId("com.android.calculator2:id/result"));
83+
var resultText = resultElement.Text;
84+
85+
// Output the result to the console
86+
Console.WriteLine("Result of 2 + 3 is: " + resultText);
87+
88+
// End the session
89+
driver.Dispose();
90+
}
91+
}
92+
```
93+
94+
## Documentation
95+
96+
For comprehensive documentation, detailed guides, and API references, please visit our [GitHub repository](https://github.com/g4-api).
97+
98+
## Contributing
99+
100+
Contributions are welcome! If you have ideas, bug fixes, or enhancements, please open an issue or submit a pull request on our [GitHub repository](https://github.com/g4-api/g4-web-driver-client).
101+
102+
## License
103+
104+
This project is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). For more details, please see the LICENSE file included in the project.
105+
106+
## Support
107+
108+
If you encounter any issues or have questions, please open an issue on our [GitHub Issues page](https://github.com/g4-api/g4-web-driver-client/issues) or contact the G4™ API Community.

docs/packages-readme/G4.WebDriver.Remote.Appium.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.Chrome.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.Chromium.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.Edge.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.Firefox.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.Ios.md

Whitespace-only changes.

docs/packages-readme/G4.WebDriver.Remote.MacOs.md

Whitespace-only changes.

0 commit comments

Comments
 (0)