-
Notifications
You must be signed in to change notification settings - Fork 15
67 lines (56 loc) · 1.77 KB
/
integration_test_on_web.yml
File metadata and controls
67 lines (56 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Integration Tests on Web
on:
# Uncomment to enable manual trigger
# workflow_dispatch:
push:
branches: [ main, master ]
paths:
- 'lib/**'
- 'web/**'
pull_request:
branches: [ main, master ]
paths:
- 'lib/**'
- 'web/**'
jobs:
web_integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.9'
channel: 'stable'
- name: Install Flutter dependencies
run: |
flutter pub get
cd example
flutter pub get
- name: Enable web support
run: flutter config --enable-web
- name: Install Chrome
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Install Python and webdriver-manager
run: |
sudo apt-get install -y python3 python3-pip
pip3 install webdriver-manager
- name: Setup ChromeDriver with webdriver-manager
run: |
# Use webdriver-manager to download the compatible ChromeDriver
CHROMEDRIVER_PATH=$(python3 -c "from webdriver_manager.chrome import ChromeDriverManager; print(ChromeDriverManager().install())")
echo "ChromeDriver installed at: $CHROMEDRIVER_PATH"
# Start ChromeDriver
$CHROMEDRIVER_PATH --port=4444 &
sleep 3 # Give ChromeDriver time to start
- name: Run integration tests on Web
run: |
cd example
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/all_tests.dart \
-d web-server \
--web-port=8080 \
--browser-name=chrome