chore: rename modules/examples to modules/playground
The directory contains code authored in a style that makes it transpilable to dart. As such, these are not idiomatic examples of Angular 2 usage. The main purpose of this directory is to enable experimentation with Angular within the angular/angular repository. Closes #4342 Closes #4639
This commit is contained in:

committed by
Flavio Corpa Ríos

parent
c3ab20cc87
commit
e4e74ae65c
@ -0,0 +1,3 @@
|
||||
library playground.e2e_test.web_workers.kitchen_sink_spec;
|
||||
|
||||
main() {}
|
@ -0,0 +1,47 @@
|
||||
import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util';
|
||||
import {Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
describe('WebWorkers Kitchen Sink', function() {
|
||||
afterEach(() => {
|
||||
verifyNoBrowserErrors();
|
||||
browser.ignoreSynchronization = false;
|
||||
});
|
||||
var selector = "hello-app .greeting";
|
||||
var URL = "playground/src/web_workers/kitchen_sink/index.html";
|
||||
|
||||
it('should greet', () => {
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
|
||||
browser.wait(protractor.until.elementLocated(by.css(selector)), 15000);
|
||||
expect(element.all(by.css(selector)).first().getText()).toEqual("hello world!");
|
||||
|
||||
});
|
||||
|
||||
it('should change greeting', () => {
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
|
||||
browser.wait(protractor.until.elementLocated(by.css(selector)), 15000);
|
||||
element(by.css("hello-app .changeButton")).click();
|
||||
var elem = element(by.css(selector));
|
||||
browser.wait(protractor.until.elementTextIs(elem, "howdy world!"), 5000);
|
||||
expect(elem.getText()).toEqual("howdy world!");
|
||||
});
|
||||
|
||||
it("should display correct key names", () => {
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
browser.wait(protractor.until.elementLocated(by.css(".sample-area")), 15000);
|
||||
|
||||
var area = element.all(by.css(".sample-area")).first();
|
||||
expect(area.getText()).toEqual('(none)');
|
||||
|
||||
area.sendKeys('u');
|
||||
browser.wait(protractor.until.elementTextIs(area, "U"), 5000);
|
||||
expect(area.getText()).toEqual("U");
|
||||
});
|
||||
});
|
@ -0,0 +1,3 @@
|
||||
library playground.e2e_test.message_bus;
|
||||
|
||||
main() {}
|
@ -0,0 +1,39 @@
|
||||
import {verifyNoBrowserErrors} from "angular2/src/testing/e2e_util";
|
||||
import {PromiseWrapper} from "angular2/src/core/facade/async";
|
||||
|
||||
var URL = 'playground/src/web_workers/message_broker/index.html';
|
||||
|
||||
describe("MessageBroker", function() {
|
||||
|
||||
afterEach(() => {
|
||||
verifyNoBrowserErrors();
|
||||
browser.ignoreSynchronization = false;
|
||||
});
|
||||
|
||||
it("should bootstrap", () => {
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
waitForBootstrap();
|
||||
expect(element(by.css("app h1")).getText()).toEqual("WebWorker MessageBroker Test");
|
||||
});
|
||||
|
||||
it("should echo messages", () => {
|
||||
const VALUE = "Hi There";
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
waitForBootstrap();
|
||||
|
||||
var input = element.all(by.css("#echo_input")).first();
|
||||
input.sendKeys(VALUE);
|
||||
element(by.css("#send_echo")).click();
|
||||
var area = element(by.css("#echo_result"));
|
||||
browser.wait(protractor.until.elementTextIs(area, VALUE), 5000);
|
||||
expect(area.getText()).toEqual(VALUE);
|
||||
});
|
||||
});
|
||||
|
||||
function waitForBootstrap(): void {
|
||||
browser.wait(protractor.until.elementLocated(by.css("app h1")), 15000);
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
library playground.e2e_test.web_workers.todo_spec;
|
||||
|
||||
main() {}
|
25
modules/playground/e2e_test/web_workers/todo/todo_spec.ts
Normal file
25
modules/playground/e2e_test/web_workers/todo/todo_spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import {verifyNoBrowserErrors} from 'angular2/src/testing/e2e_util';
|
||||
import {Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
describe('WebWorkers Todo', function() {
|
||||
afterEach(() => {
|
||||
verifyNoBrowserErrors();
|
||||
browser.ignoreSynchronization = false;
|
||||
});
|
||||
|
||||
var URL = "playground/src/web_workers/todo/index.html";
|
||||
|
||||
it('should bootstrap', () => {
|
||||
// This test can't wait for Angular 2 as Testability is not available when using WebWorker
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get(URL);
|
||||
|
||||
waitForBootstrap();
|
||||
expect(element(by.css("#todoapp header")).getText()).toEqual("todos");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function waitForBootstrap(): void {
|
||||
browser.wait(protractor.until.elementLocated(by.css("todo-app #todoapp")), 15000);
|
||||
}
|
Reference in New Issue
Block a user