Skip to content

Commit

Permalink
webdriver: Store webdriver apk as artifact in workflow
Browse files Browse the repository at this point in the history
Also update WebDriver README instructions
  • Loading branch information
zhani committed Jan 23, 2024
1 parent 96cf429 commit 5b65229
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-latest-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ jobs:
run: |
mv -f minibrowser-Debug/debug/minibrowser-debug.apk minibrowser-latest.apk
mv -f mediaplayer-Debug/debug/mediaplayer-debug.apk mediaplayer-latest.apk
mv -f webdriver-Debug/debug/webdriver-debug.apk webdriver-latest.apk
- name: Delete Artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
minibrowser-Debug
mediaplayer-Debug
webdriver-Debug
- name: Upload Latest Preview Files
uses: softprops/action-gh-release@v1
with:
Expand All @@ -43,3 +45,4 @@ jobs:
files: |
minibrowser-latest.apk
mediaplayer-latest.apk
webdriver-latest.apk
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ jobs:
with:
name: mediaplayer-${{ inputs.build_type }}
path: tools/mediaplayer/build/outputs/apk/**/*.apk
- name: Save WebDriver Artifacts
uses: actions/upload-artifact@v3
with:
name: webdriver-${{ inputs.build_type }}
path: tools/webdriver/build/outputs/apk/**/*.apk
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,22 @@ Once the bootstrap process is done and all the dependencies are cross-compiled a
you should be able to open the `launcher` demo with Android Studio and run it on a real device.

## WebDriver
WebDriver support is not yet included in prebuilt packages but wpewebkit needs to be compile
manually for now and only x86-64 emulator environment is supported.

### 1. Build wpewebkit with webdriver support
Go to [cerbero](https://github.com/Igalia/cerbero) repository clone and issue
Following demostrates how to run a simple webdriver script on emulator

```bash
./cerbero-uninstalled -c config/cross-android-x86-64.cbc bootstrap
./cerbero-uninstalled -c config/cross-android-x86-64.cbc package wpewebkit
```
### 2. Bootstrap wpe-android with webdriver enabled wpewebkit
In wpe-android directory issue
### 1. Create python virtual environment for Selenium

```bash
./tools/scripts/bootstrap.py --arch x86_64 -c <path_to_cerbero>
```
### 3. Create python virtual environment for selenium
Create directory for selenium (to any location you want)
Create directory for Selenium (to any location you want)

```bash
python3 -m venv venv
source venv/bin/activate
pip install selenium
```

Save following as run_test.py
### 2. Create python Selenium script

Save following as simple_test.py

```bash
from selenium import webdriver
Expand All @@ -127,21 +117,23 @@ del(options._caps["platform"])
del(options._caps["version"])

driver = webdriver.Remote(command_executor="http://127.0.0.1:8888", options=options)
driver.get('http://www.google.com')
driver.get('http://www.wpewebkit.org')
driver.quit()
```
### 4. Run webdriver application
### 3. Run webdriver application on emulator

From android studio run webdriver application on x86-64 emulator.
After emulator has started issue fullowing
After emulator has started issue following on terminal

```bash
adb forward tcp:8888 tcp:8888
```
### 5. Run WebDriver Selenium tests
In selenium directory created previously run
### 4. Run WebDriver Selenium tests

From Selenium directory created previously run

```bash
python3 ./run_test.py
python3 ./simple_test.py
```

## Known issues and limitations
Expand Down

0 comments on commit 5b65229

Please sign in to comment.