Skip to content

Commit

Permalink
Merge pull request #67 from goderbauer/seperation
Browse files Browse the repository at this point in the history
Divide async and sync pageloader into two packages
  • Loading branch information
goderbauer committed Feb 5, 2016
2 parents 83930ba + 01ee23c commit fb464c5
Show file tree
Hide file tree
Showing 55 changed files with 599 additions and 62 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ dart:
- dev
- stable

with_content_shell: true

matrix:
allow_failures:
- dart: dev

before_install:
- export CHROMEDRIVER_BINARY=/usr/bin/chromium-browser
- export CHROMEDRIVER_ARGS=--no-sandbox
Expand All @@ -19,6 +25,9 @@ before_script:
- wget http://chromedriver.storage.googleapis.com/2.12/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- export PATH=$PATH:$PWD
- ./dart/tool/travis-setup.sh
- ./dart/async/tool/travis-setup.sh
- ./dart/sync/tool/travis-setup.sh

script: ./dart/tool/travis.sh
script:
- ./dart/async/tool/travis.sh
- ./dart/sync/tool/travis.sh
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PageLoader
==========

[![Build Status](https://travis-ci.org/google/pageloader.svg?branch=master)](https://travis-ci.org/google/pageloader)
[![pub package](https://img.shields.io/pub/v/pageloader.svg)](https://pub.dartlang.org/packages/pageloader)

A framework for creating page objects for in-browser tests or
WebDriver tests.
Expand All @@ -11,10 +10,16 @@ PageLoader for Dart comes in two flavours: async and sync.

Async PageLoader for Dart
-------------------------

[![pub package](https://img.shields.io/pub/v/pageloader.svg)](https://pub.dartlang.org/packages/pageloader)

Async PageLoader for Dart is the **recommended** version going forward. It is designed to work with [webdriver.dart](https://github.com/google/webdriver.dart).

Sync PageLoader for Dart
------------------------

[![pub package](https://img.shields.io/pub/v/sync_pageloader.svg)](https://pub.dartlang.org/packages/sync_pageloader)

The sync version is **deprecated** and will eventually be **removed** from this repository.
Consider switching to the async version.

Expand Down
1 change: 0 additions & 1 deletion dart/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion dart/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion dart/lib/async/html.dart → dart/async/lib/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/// PageLoader HTML provides the necessary bindings to support using PageLoader
/// Objects in tests that run within the browser.
library pageloader.async.html;
library pageloader.html;

import 'dart:async';
import 'dart:html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/// PageLoader Objects provides the core interface and annotation definitions
/// that should be used within PageLoader Objects.
library pageloader.async.objects;
library pageloader.objects;

export 'src/annotations.dart';
export 'src/interfaces.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.annotations;
library pageloader.annotations;

import 'dart:async';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.core;
library pageloader.core;

import 'dart:async';
import 'dart:collection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.interfaces;
library pageloader.interfaces;

import 'dart:async';
import 'dart:math';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/// PageLoader WebDriver provides the necessary bindings to support using
/// PageLoader in WebDriver-based tests.
library pageloader.async.webdriver;
library pageloader.webdriver;

import 'dart:async';
import 'dart:math';
Expand Down
15 changes: 15 additions & 0 deletions dart/async/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pageloader
version: 2.0.0-pre.14
author: Marc Fisher II <[email protected]>
description: >
Supports the creation of page objects that can be shared between in-browser tests
and WebDriver tests.
homepage: https://github.com/google/pageloader
environment:
sdk: '>=1.11.0 <2.0.0'
dependencies:
stack_trace: '^1.3.4'
webdriver: '^0.10.0-pre.15'
dev_dependencies:
path: '^1.3.6'
test: '^0.12.3+9'
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// limitations under the License.

@TestOn('browser')
library pageloader.async.test.html_no_shadow_dom;
library pageloader.test.html_no_shadow_dom;

import 'dart:async';

import 'package:pageloader/async/html.dart';
import 'package:pageloader/html.dart';

import 'package:test/test.dart';

import '../data/html_no_shadow_dom_setup.dart' as html_setup;
import 'data/html_no_shadow_dom_setup.dart' as html_setup;
import 'src/common.dart' as plt;
import 'src/html_pageloader.dart' as html_test;
import 'src/shared.dart' as shared;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// limitations under the License.

@TestOn('browser')
library pageloader.async.test.html_no_shadow_dom;
library pageloader.test.html_no_shadow_dom;

import 'dart:async';

import 'package:pageloader/async/html.dart';
import 'package:pageloader/html.dart';
import 'package:test/test.dart';

import '../data/html_setup.dart' as html_setup;
import 'data/html_setup.dart' as html_setup;
import 'src/common.dart' as plt;
import 'src/html_pageloader.dart' as html_test;
import 'src/shared.dart' as shared;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.annotation;
library pageloader.test.annotation;

import 'dart:async';
import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.attribute;
library pageloader.test.attribute;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.basic;
library pageloader.test.basic;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down Expand Up @@ -95,6 +95,8 @@ void runTests() {

await page.textfield.blur();
expect(await page.textfield.isFocused, false);
}, onPlatform: {
'content-shell': new Skip('Focus events do not work in content-shell')
});

test('classes', () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test;
library pageloader.test;

import 'package:test/test.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.display_filtering;
library pageloader.test.display_filtering;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.error;
library pageloader.test.error;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
library pageloader.async.test.html;
library pageloader.test.html;

import 'dart:async';
import 'dart:html' as html;

import 'package:pageloader/async/html.dart';
import 'package:pageloader/async/objects.dart';
import 'package:pageloader/html.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.mouse;
library pageloader.test.mouse;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'package:webdriver/support/async.dart';
import 'shared.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.shadow_dom;
library pageloader.test.shadow_dom;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.shared;
library pageloader.test.shared;

import 'package:test/test.dart';
import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';

PageLoader loader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

library pageloader.async.test.typing;
library pageloader.test.typing;

import 'package:pageloader/async/objects.dart';
import 'package:pageloader/objects.dart';
import 'package:test/test.dart';
import 'shared.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// limitations under the License.

@TestOn('vm')
library pageloader.async.test.webdriver;
library pageloader.test.webdriver;

import 'dart:async';
import 'dart:io';

import 'package:pageloader/async/webdriver.dart' show WebDriverPageLoader;
import 'package:pageloader/webdriver.dart' show WebDriverPageLoader;
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
import 'package:webdriver/io.dart' show Capabilities, WebDriver, createDriver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// limitations under the License.

@TestOn('vm')
library pageloader.async.test.webdriver;
library pageloader.test.webdriver;

import 'dart:async';
import 'dart:io';

import 'package:pageloader/async/webdriver.dart' show WebDriverPageLoader;
import 'package:pageloader/webdriver.dart' show WebDriverPageLoader;
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
import 'package:webdriver/io.dart' show Capabilities, WebDriver, createDriver;
Expand Down
11 changes: 11 additions & 0 deletions dart/async/tool/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set -e

if [ ! -f pubspec.yaml ]; then
echo "Error: No pubspec.yml in working directory."
exit
fi

cp ../../LICENSE LICENSE
cp ../../README.md README.md
pub get
pub publish
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Fast fail the script on failures.
set -e

cd dart
cd dart/async

pub get
packages/sync_socket/../tool/build.sh
34 changes: 34 additions & 0 deletions dart/async/tool/travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Copyright 2013 Google Inc. All Rights Reserved.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Fast fail the script on failures.
set -e

cd dart/async

# Verify that the libraries are error free.
pub global activate tuneup
pub global run tuneup check

# Start chromedriver.
chromedriver --port=4444 --url-base=wd/hub &
PID=$!

# Run tests.
pub run test -r expanded -p vm,content-shell

# Exit chromedriver
kill $PID
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit fb464c5

Please sign in to comment.