Kendo-angular: Protractor Test

Created on 14 Mar 2017  路  2Comments  路  Source: telerik/kendo-angular

Hi,

any idea how to get the kendo grid to work with testing and protractor (npm test)

14 03 2017 15:29:55.334:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket /#7HbulpGG14g9KgPJAAAA with id 38114337 Chrome 56.0.2924 (Windows 10 0.0.0) AppComponent should create the app FAILED Can't bind to 'data' since it isn't a known property of 'kendo-grid'.

With default sample from http://www.telerik.com/kendo-angular-ui/components/grid/

<kendo-grid [data]="gridData" [height]="370">
            <kendo-grid-column field="ProductID" title="ID" width="40">
            </kendo-grid-column>
            <kendo-grid-column field="ProductName" title="Name" width="250">
            </kendo-grid-column>
            <kendo-grid-column field="Category.CategoryName" title="Category">
            </kendo-grid-column>
            <kendo-grid-column field="UnitPrice" title="Price" width="80">
            </kendo-grid-column>
            <kendo-grid-column field="UnitsInStock" title="In stock" width="80">
            </kendo-grid-column>
            <kendo-grid-column field="Discontinued" title="Discontinued" width="120">
                <template kendoGridCellTemplate let-dataItem>
                    <input type="checkbox" [checked]="dataItem.Discontinued" disabled/>
                </template>
            </kendo-grid-column>
        </kendo-grid>

Most helpful comment

Okay figured out myself. Protractor doesn't get the needed imports
by itself. So just add them on the app.component.spec.ts
and you're good to go.

TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
      imports: [
            GridModule
      ],
      schemas: [CUSTOM_ELEMENTS_SCHEMA]
    });

14 03 2017 16:55:41.634:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/ 14 03 2017 16:55:41.634:INFO [launcher]: Launching browser Chrome with unlimited concurrency 14 03 2017 16:55:41.902:INFO [launcher]: Starting browser Chrome 14 03 2017 16:55:44.579:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket /#LUvF0Q9QN73ID0PoAAAA with id 18605196 Chrome 56.0.2924 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (3.598 secs / 3.592 secs)

馃

All 2 comments

Okay figured out myself. Protractor doesn't get the needed imports
by itself. So just add them on the app.component.spec.ts
and you're good to go.

TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
      imports: [
            GridModule
      ],
      schemas: [CUSTOM_ELEMENTS_SCHEMA]
    });

14 03 2017 16:55:41.634:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/ 14 03 2017 16:55:41.634:INFO [launcher]: Launching browser Chrome with unlimited concurrency 14 03 2017 16:55:41.902:INFO [launcher]: Starting browser Chrome 14 03 2017 16:55:44.579:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket /#LUvF0Q9QN73ID0PoAAAA with id 18605196 Chrome 56.0.2924 (Windows 10 0.0.0): Executed 3 of 3 SUCCESS (3.598 secs / 3.592 secs)

馃

Damn wrong button.

Was this page helpful?
0 / 5 - 0 ratings