Skip to content

Commit b6df16d

Browse files
committed
Merge pull request #4466 from JLLeitschuh/chore/fixE2EbeforeRelease
chore(e2e): Fixes the e2e tests
2 parents 9c256bf + 6c4444a commit b6df16d

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

misc/tutorial/103_filtering.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ Refer {@link 321_singleFilter singleFilter tutorial}, it is possible to implemen
225225
describe('first grid on the page, filtered by male by default', function() {
226226
gridTestUtils.firefoxReload();
227227

228-
it('grid should have seven visible columns', function () {
229-
gridTestUtils.expectHeaderColumnCount( 'grid1', 7 );
228+
it('grid should have eight visible columns', function () {
229+
gridTestUtils.expectHeaderColumnCount( 'grid1', 8 );
230230
});
231231

232232
it('filter on 4 columns, filter with greater than/less than on one, one with no filter, then one with one filter', function () {

misc/tutorial/121_grid_menu.ngdoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
@ngdoc overview
22
@name Tutorial: 121 Grid Menu
3-
@description The grid menu can be enabled through setting the gridOption `enableGridMenu`. This
3+
@description The grid menu can be enabled through setting the gridOption `enableGridMenu`. This
44
adds a settings icon in the top right of the grid, which floats above the column header. The
55
menu by default gives access to show/hide columns, but can be customised to show additional
6-
actions.
6+
actions.
77

88
You can customize a the menu and provide your own functionality. Each menu item can have:
99

1010
- `shown`: a function that determines whether or not to display the item
11-
- `title`: the title you'd like to have displayed for the menu item (note that you can also
11+
- `title`: the title you'd like to have displayed for the menu item (note that you can also
1212
use i18n on this through the `gridMenuTitleFilter` setting)
1313
- `icon`: an icon you'd like displayed alongside the item
1414
- `action`: a function that will be called when the menu is clicked
1515
- `active`: a function that highlights the item (giving a toggle type effect - see the sort on the column menus for an example)
16-
- `context`: by default, the `action`, `shown` and `active`'s' contexts will have a reference to the grid added as the
17-
property `grid` (accessible through `this.grid`. You can pass in your own context by supplying
16+
- `context`: by default, the `action`, `shown` and `active`'s' contexts will have a reference to the grid added as the
17+
property `grid` (accessible through `this.grid`. You can pass in your own context by supplying
1818
the `context` property to your menu item. It will be accessible through `this.context`.
1919
- `leaveOpen`: by default false, if set to true the menu will be left open after the action
2020
- `order`: the order in the menu that you wish your item to be. Columns are 300 -> 300 + numColumns * 2,
21-
importer and exporter are 150 and 200 respectively
21+
importer and exporter are 150 and 200 respectively
2222

2323
The exporter feature also adds menu items to this menu. The `exporterMenuCsv` option is set
2424
to false, which suppresses csv export. The 'export selected rows' option is only available
@@ -27,7 +27,7 @@ if at least one row is selected.
2727
The column titles can have a custom filter defined using `gridMenuTitleFilter`, used when your
2828
column headers have an internationalization filter (angular translate or i18nService), and you
2929
want them also internationalized in the grid menu. The translate needs to return either a string,
30-
or a promise that will resolve to a string. In the example below we create a fake
30+
or a promise that will resolve to a string. In the example below we create a fake
3131
internationalization function that waits 1 second then prefixes each column with "col: ".
3232

3333
You can suppress the ability to show and hide columns by setting the gridOption `gridMenuShowHideColumns: false`,
@@ -54,7 +54,7 @@ In the meantime, you can override the height to fit with your application in you
5454
}, 1000, 1);
5555
return deferred.promise;
5656
};
57-
57+
5858
$scope.gridOptions = {
5959
exporterMenuCsv: false,
6060
enableGridMenu: true,
@@ -75,12 +75,12 @@ In the meantime, you can override the height to fit with your application in you
7575
],
7676
onRegisterApi: function( gridApi ){
7777
$scope.gridApi = gridApi;
78-
78+
7979
// interval of zero just to allow the directive to have initialized
8080
$interval( function() {
8181
gridApi.core.addToGridMenu( gridApi.grid, [{ title: 'Dynamic item', order: 100}]);
8282
}, 0, 1);
83-
83+
8484
gridApi.core.on.columnVisibilityChanged( $scope, function( changedColumn ){
8585
$scope.columnChanged = { name: changedColumn.colDef.name, visible: changedColumn.colDef.visible };
8686
});
@@ -141,14 +141,14 @@ In the meantime, you can override the height to fit with your application in you
141141
it('grid1 grid menu should have 8 items', function () {
142142
gridTestUtils.expectVisibleGridMenuItems( 'grid1', 7 );
143143
});
144-
144+
145145
it('grid1 hide then show company column', function () {
146146
gridTestUtils.expectHeaderColumnCount( 'grid1', 3 );
147147
gridTestUtils.expectHeaderCellValueMatch( 'grid1', 0, 'Name' );
148148
gridTestUtils.expectHeaderCellValueMatch( 'grid1', 1, 'Gender' );
149149
gridTestUtils.expectHeaderCellValueMatch( 'grid1', 2, 'Company' );
150150

151-
gridTestUtils.clickGridMenuItem( 'grid1', 11 ) // there are some hidden menu items, this is company_hide
151+
gridTestUtils.clickGridMenuItem( 'grid1', 12 ) // there are some hidden menu items, this is company_hide
152152
.then(function () {
153153
gridTestUtils.expectHeaderColumnCount( 'grid1', 2 );
154154
gridTestUtils.expectHeaderCellValueMatch( 'grid1', 0, 'Name' );
@@ -157,7 +157,7 @@ In the meantime, you can override the height to fit with your application in you
157157
return gridTestUtils.unclickGridMenu( 'grid1'); // menu stays open if change columns
158158
})
159159
.then(function() {
160-
return gridTestUtils.clickGridMenuItem( 'grid1', 12 ); // there are some hidden menu items, this is company_show
160+
return gridTestUtils.clickGridMenuItem( 'grid1', 13 ); // there are some hidden menu items, this is company_show
161161
})
162162
.then(function() {
163163
gridTestUtils.expectHeaderColumnCount( 'grid1', 3 );
@@ -168,5 +168,5 @@ In the meantime, you can override the height to fit with your application in you
168168
});
169169
});
170170

171-
</file>
172-
</example>
171+
</file>
172+
</example>

src/templates/ui-grid/uiGridHeaderCell.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
col-index="renderIndex"
1111
title="TOOLTIP">
1212
<span
13+
class="ui-grid-header-cell-label"
1314
ui-grid-one-bind-id-grid="col.uid + '-header-text'">
1415
{{ col.displayName CUSTOM_FILTERS }}
1516
</span>

test/e2e/gridTestUtils.spec.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ module.exports = {
192192
var headerColumns = this.getGrid(gridId)
193193
.element(by.css('.ui-grid-render-container-body'))
194194
.element( by.css('.ui-grid-header'))
195-
.all(by.repeater('col in colContainer.renderedColumns track by col.uid'));
195+
.all(by.repeater('col in colContainer.renderedColumns track by col.uid'))
196+
.all(by.css('.ui-grid-header-cell-label'));
196197

197198
expect(headerColumns.count()).toBe(expectedColumns.length);
198199

@@ -327,7 +328,8 @@ module.exports = {
327328
*/
328329
expectHeaderCellValueMatch: function( gridId, expectedCol, expectedValue ) {
329330
var headerCell = this.headerCell( gridId, expectedCol);
330-
expect(headerCell.getText()).toMatch(expectedValue);
331+
var headerCellValue = headerCell.element(by.css('.ui-grid-header-cell-label')).getText();
332+
expect(headerCellValue).toMatch(expectedValue);
331333
},
332334

333335
/**
@@ -811,7 +813,8 @@ module.exports = {
811813
// NOTE: Can't do .click() as it doesn't work when webdriving Firefox
812814
return browser.actions().mouseMove(gridMenuButton).mouseDown(gridMenuButton).mouseUp().perform()
813815
.then(function () {
814-
var row = gridMenuButton.element( by.repeater('item in menuItems').row( itemNumber) );
816+
var row = gridMenuButton.element( by.repeater('item in menuItems').row( itemNumber) )
817+
.element(by.css('.ui-grid-menu-item'));
815818

816819
return browser.actions().mouseMove(row).mouseDown(row).mouseUp().perform();
817820
});

0 commit comments

Comments
 (0)