Permalink
Browse files

feat(protractor): 'serenity-js/protractor' gives easy access to 'sere…

…nity-js/lib/screenplay-protractor'

affects: serenity-js

`import { Task, Enter, Click, ... } from 'serenity-js/lib/screenplay-protractor'` can be replaced with
`import { Task, Enter, Click, ... } from 'serenity-js/protractor'`
This is one of the first steps towards extracting protractor support into its own module.
It will also save you some key strokes.
  • Loading branch information...
jan-molak committed Nov 7, 2017
1 parent dd2dd06 commit 029e5f4c40ac656cc8f5d76351a8805e12b93d73
@@ -358,7 +358,7 @@ Let's update the Cucumber step definitions to include our new code:
// features/step_definitions/todo_user.steps.ts
import { Actor } from 'serenity-js/lib/screenplay';
import { BrowseTheWeb } from 'serenity-js/lib/screenplay-protractor';
import { BrowseTheWeb } from 'serenity-js/protractor';
import { protractor } from 'protractor';
@@ -389,7 +389,7 @@ to the application could be a good start:
```typescript
// ...
import { Open } from 'serenity-js/lib/screenplay-protractor';
import { Open } from 'serenity-js/protractor';
export class Start implements Task {
@@ -432,7 +432,7 @@ we can use another built-in Interaction - `Enter`:
// src/screenplay/tasks/add_a_todo_item.ts
import { PerformsTasks, Task } from 'serenity-js/lib/screenplay';
import { Enter } from 'serenity-js/lib/screenplay-protractor';
import { Enter } from 'serenity-js/protractor';
import { protractor } from 'protractor';
@@ -462,7 +462,7 @@ There's one thing missing though: we haven't defined what `TodoList.What_Needs_T
```typescript
// src/screenplay/ui/todo_list.ts
import { Target } from 'serenity-js/lib/screenplay-protractor';
import { Target } from 'serenity-js/protractor';
import { by } from 'protractor';
export class TodoList {
@@ -543,7 +543,7 @@ identified by a `Target`:
```typescript
// src/screenplay/questions/todo_list_items.ts
import { Text } from 'serenity-js/lib/screenplay-protractor';
import { Text } from 'serenity-js/protractor';
import { TodoList } from '../ui/todo_list';
@@ -557,7 +557,7 @@ And the Target:
```typescript
// src/screenplay/ui/todo_list.ts
import { Target } from 'serenity-js/lib/screenplay-protractor';
import { Target } from 'serenity-js/protractor';
import { by } from 'protractor';
export class TodoList {
@@ -298,7 +298,7 @@ giving the Task a more descriptive name:
// src/screenplay/tasks/start.ts
import { PerformsTasks, Task } from 'serenity-js/lib/screenplay';
import { Open, step } from 'serenity-js/lib/screenplay-protractor'; // imports the @step
import { Open, step } from 'serenity-js/protractor'; // imports the @step
import { AddATodoItem } from './add_a_todo_item';
@@ -335,7 +335,7 @@ Now, repeat the process with the `AddATodoItem` task:
// src/screenplay/tasks/add_a_todo_item.ts
import { PerformsTasks, Task } from 'serenity-js/lib/screenplay';
import { Enter, step } from 'serenity-js/lib/screenplay-protractor'; // imports the @step
import { Enter, step } from 'serenity-js/protractor'; // imports the @step
import { protractor } from 'protractor';
@@ -411,7 +411,7 @@ so let's make the following changes to the `todo_user.steps.ts`:
# features/step_definitions/todo_user.steps.ts
import { Serenity } from 'serenity-js';
import { Actor, BrowseTheWeb } from 'serenity-js/lib/screenplay-protractor';
import { Actor, BrowseTheWeb } from 'serenity-js/protractor';
import { protractor } from 'protractor';
import { Start } from '../../src/screenplay/tasks/start';
@@ -86,6 +86,7 @@
"docs",
"examples/**",
"lib",
"**/protractor.d.ts",
"spec",
"staging",
"node_modules"
@@ -0,0 +1 @@
export * from './lib/screenplay-protractor';
@@ -0,0 +1 @@
module.exports = require('./lib/screenplay-protractor');

0 comments on commit 029e5f4

Please sign in to comment.