Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
using chromedriverinstaller as a library. Fixing the commit number us…
…ed from web_installers repo
  • Loading branch information
nturgut committed Mar 21, 2020
commit 19c399ca633cf2a2116893a082b1ec9ca873b43b
19 changes: 14 additions & 5 deletions lib/web_ui/dev/integration_tests_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'dart:io' as io;
import 'package:path/path.dart' as pathlib;
import 'package:web_driver_installer/chrome_driver_installer.dart';

import 'common.dart';
import 'environment.dart';
Expand Down Expand Up @@ -117,17 +118,25 @@ class IntegrationTestsManager {
}

Future<bool> prepareDriver() async {
final io.Directory priorCurrentDirectory = io.Directory.current;
if (_driverDir.existsSync()) {
_driverDir.deleteSync(recursive: true);
Comment thread
nturgut marked this conversation as resolved.
Outdated
}

_driverDir.createSync(recursive: true);

// TODO(nurhan): We currently need git clone for getting the driver lock
// file. Remove this after making changes in web_installers.
bool installWebInstallers = await _cloneWebInstallers();
if (installWebInstallers) {
bool pubGet = await _runPubGet(pathlib.join(
_driverDir.path, 'web_installers', 'packages', 'web_drivers'));
if (pubGet) {
// Change the directory to the driver_lock.yaml file's directory.
io.Directory.current = pathlib.join(
_driverDir.path, 'web_installers', 'packages', 'web_drivers');
ChromeDriverInstaller chromeDriverInstaller = ChromeDriverInstaller();
Comment thread
nturgut marked this conversation as resolved.
Outdated
bool installation = await chromeDriverInstaller.install();

if (installation) {
io.Directory.current = priorCurrentDirectory;
return await _runDriver();
} else {
return false;
Expand Down Expand Up @@ -287,15 +296,15 @@ class IntegrationTestsManager {
/// file which drives it. The driver file should be named:
/// {name}_test.dart
void _checkE2ETestsValidity(io.Directory testDirectory) {
final List<io.Directory> directories =
final Iterable<io.Directory> directories =
testDirectory.listSync(followLinks: false).whereType<io.Directory>();

if (directories.length > 0) {
throw StateError('${testDirectory.path} directory should not contain '
'any sub-directories');
}

final List<io.File> entities =
final Iterable<io.File> entities =
testDirectory.listSync(followLinks: false).whereType<io.File>();

final Set<String> expectedDriverFileNames = Set<String>();
Expand Down
5 changes: 5 additions & 0 deletions lib/web_ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ dev_dependencies:
watcher: 0.9.7+12
web_engine_tester:
path: ../../web_sdk/web_engine_tester
web_driver_installer:
git:
url: git://github.com/flutter/web_installers.git
path: packages/web_drivers/
ref: dae38d8839cc39f997fb4229f1382680b8758b4f