Skip to content

Commit

Permalink
Add Protractor test ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
Fzwael committed Feb 23, 2020
1 parent 1b8502f commit 57807d4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ export class AppComponent {
}
```

### Configuring Protractor & Cucumber
### Configuring Protractor & Cucumber

#### Installing Protractor:
To install Protractor you can follow the official documentation found in : [protractortest.org](https://www.protractortest.org/).

Running the following commands will do it :
```
npm install -g protractor
webdriver-manager update
ng e2e --port 4201
```

Angular should have created a test file called **app.e2e-spec.ts** with a test named **should display welcome message**.
You can modify that test to the following to test if everything is working fine (We will keep the default configuration for Protractor provided by Angular CLI):

``` typescript
it('should have AngularBdd as a title', () => {
page.navigateTo();
expect(browser.getTitle()).toEqual('AngularBdd');
});
```
4 changes: 2 additions & 2 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ describe('workspace-project App', () => {
page = new AppPage();
});

it('should display welcome message', () => {
it('should have AngularBdd as a title', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('angular-bdd app is running!');
expect(browser.getTitle()).toEqual('AngularBdd');
});

afterEach(async () => {
Expand Down

0 comments on commit 57807d4

Please sign in to comment.