This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 3 files changed +73
-0
lines changed
3 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ // An example configuration file.
2
+ exports . config = {
3
+ directConnect : true ,
4
+
5
+ // Capabilities to be passed to the webdriver instance.
6
+ capabilities : {
7
+ 'browserName' : 'chrome'
8
+ } ,
9
+
10
+ // Framework to use. Jasmine is recommended.
11
+ framework : 'jasmine' ,
12
+
13
+ // Spec patterns are relative to the current working directory when
14
+ // protractor is called.
15
+ specs : [
16
+ 'input_spec.js' ,
17
+ 'mat_paginator_spec.js'
18
+ ] ,
19
+
20
+ // Disable promise manager because we are going to use async/await
21
+ SELENIUM_PROMISE_MANAGER : false ,
22
+
23
+ // Options to be passed to Jasmine.
24
+ jasmineNodeOpts : {
25
+ defaultTimeoutInterval : 30000
26
+ }
27
+ } ;
Original file line number Diff line number Diff line change
1
+ describe ( 'angular-material input component page' , function ( ) {
2
+ const EC = protractor . ExpectedConditions ;
3
+
4
+ it ( 'Should change input component value' , async ( ) => {
5
+ await browser . get ( 'https://material.angular.io/components/input/examples' ) ;
6
+
7
+ await browser . wait ( EC . elementToBeClickable ( $ ( '.mat-button-wrapper>.mat-icon' ) ) , 5000 ) ;
8
+
9
+ const emailInputField = $$ ( '.mat-form-field-infix>input' ) . get ( 1 ) ;
10
+
11
+ await emailInputField . sendKeys ( 'invalid' ) ;
12
+
13
+ expect ( $ ( 'mat-error' ) . isPresent ( ) ) . toBe ( true ) ;
14
+ } ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change
1
+ describe ( 'angular-material paginator component page' , ( ) => {
2
+ const EC = protractor . ExpectedConditions ;
3
+
4
+ beforeAll ( async ( ) => {
5
+ await browser . get ( 'https://material.angular.io/components/paginator/examples' ) ;
6
+
7
+ await browser . wait ( EC . elementToBeClickable ( $ ( '.mat-button-wrapper>.mat-icon' ) ) , 5000 ) ;
8
+ } ) ;
9
+
10
+ it ( 'Should navigate to next page' , async ( ) => {
11
+ await $ ( 'button[aria-label=\'Next page\']' ) . click ( ) ;
12
+
13
+ await expect ( $ ( '.mat-paginator-range-label' ) . getAttribute ( 'innerText' ) ) . toEqual ( '11 - 20 of 100' ) ;
14
+ } ) ;
15
+
16
+ it ( 'Should navigate to previous page' , async ( ) => {
17
+ await $ ( 'button[aria-label=\'Previous page\']' ) . click ( ) ;
18
+
19
+ await expect ( $ ( '.mat-paginator-range-label' ) . getAttribute ( 'innerText' ) ) . toEqual ( '1 - 10 of 100' ) ;
20
+ } ) ;
21
+
22
+ it ( 'Should change list length to 5 items per page' , async ( ) => {
23
+ await $ ( 'mat-select>div' ) . click ( ) ;
24
+
25
+ const fiveItemsOption = $$ ( 'mat-option>.mat-option-text' ) . first ( ) ;
26
+
27
+ await fiveItemsOption . click ( ) ;
28
+
29
+ await expect ( $ ( '.mat-paginator-range-label' ) . getAttribute ( 'innerText' ) ) . toEqual ( '1 - 5 of 100' ) ;
30
+ } ) ;
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments