-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support mac command key when opening view in new view tab
fixes: #155
- Loading branch information
1 parent
0060c11
commit b2be851
Showing
19 changed files
with
267 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...plication-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a [wbRouterLink]="{'entity': 'testing'}" class="e2e-testing-view-link">Testing View</a> |
22 changes: 22 additions & 0 deletions
22
...application-platform/testing-app/src/app/testing/view-b8bbbb11/view-b8bbbb11.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
import { provideWorkbenchView } from '@scion/workbench-application.angular'; | ||
|
||
@Component({ | ||
selector: 'app-view-b8bbbb11', | ||
templateUrl: 'view-b8bbbb11.component.html', | ||
providers: [ | ||
provideWorkbenchView(ViewB8bbbb11Component), | ||
], | ||
}) | ||
export class ViewB8bbbb11Component { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a [wbRouterLink]="['/view']" class="e2e-view-link">View</a> |
25 changes: 25 additions & 0 deletions
25
projects/app/workbench/workbench-app/src/app/view-bb9700a6/view-bb9700a6.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
import { WorkbenchView } from '@scion/workbench'; | ||
|
||
@Component({ | ||
selector: 'app-view-bb9700a6', | ||
templateUrl: 'view-bb9700a6.component.html', | ||
}) | ||
|
||
export class ViewBb9700a6Component { | ||
|
||
constructor(view: WorkbenchView) { | ||
view.title = 'Testcase bb9700a6'; | ||
view.cssClass = 'e2e-view-bb9700a6'; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
projects/e2e/workbench-application-platform/src/page-object/testcase-b8bbbb11-view.po.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { clickElement, switchToIFrameContext } from '../util/testing.util'; | ||
import { $ } from 'protractor'; | ||
|
||
const E2E_TESTING_VIEW_CONTEXT = ['e2e-testing-app', 'e2e-view', 'e2e-view-b8bbbb11']; | ||
|
||
export class TestcaseB8bbbb11ViewPO { | ||
|
||
private _linkFinder = $('a.e2e-testing-view-link'); | ||
|
||
public async clickLink(pressKey?: string): Promise<void> { | ||
await switchToIFrameContext(E2E_TESTING_VIEW_CONTEXT); | ||
|
||
if (pressKey) { | ||
await clickElement(this._linkFinder, pressKey); | ||
} else { | ||
await this._linkFinder.click(); | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
projects/e2e/workbench-application-platform/src/router-link.e2e-spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { browser, Key } from 'protractor'; | ||
import { TestcaseB8bbbb11ViewPO } from './page-object/testcase-b8bbbb11-view.po'; | ||
import { TestingViewPO } from './page-object/testing-view.po'; | ||
import { HostAppPO } from './page-object/host-app.po'; | ||
|
||
describe('RouterLink', () => { | ||
|
||
const hostAppPO = new HostAppPO(); | ||
const testingViewPO = new TestingViewPO(); | ||
const viewPO = new TestcaseB8bbbb11ViewPO(); | ||
|
||
beforeEach(async () => { | ||
await browser.get('/'); | ||
await testingViewPO.navigateTo(); | ||
const viewNavigationPO = await testingViewPO.openViewNavigationPanel(); | ||
await viewNavigationPO.enterQualifier({ | ||
entity: 'testing', | ||
testcase: 'b8bbbb11-view', | ||
}); | ||
await viewNavigationPO.selectTarget('self'); | ||
await viewNavigationPO.execute(); | ||
}); | ||
|
||
it('should open testing view in current view [testcase: b8bbbb11-view]', async () => { | ||
await viewPO.clickLink(); | ||
await expect(hostAppPO.getViewTabCount()).toBe(1); | ||
}); | ||
|
||
it('should open testing view in new view tab when CTRL + click [testcase: b8bbbb11-view]', async () => { | ||
await viewPO.clickLink(Key.CONTROL); | ||
await expect(hostAppPO.getViewTabCount()).toBe(2); | ||
}); | ||
|
||
it('should open testing view in new view tab when COMMAND + click [testcase: b8bbbb11-view]', async () => { | ||
await viewPO.clickLink(Key.COMMAND); | ||
await expect(hostAppPO.getViewTabCount()).toBe(2); | ||
}); | ||
|
||
it('should open testing view in new view tab when META + click [testcase: b8bbbb11-view]', async () => { | ||
await viewPO.clickLink(Key.META); | ||
await expect(hostAppPO.getViewTabCount()).toBe(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
projects/e2e/workbench/src/page-object/testcase-bb9700a6-view.po.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { $ } from 'protractor'; | ||
import { clickElement } from '../util/testing.util'; | ||
|
||
export class TestcaseBb9700a6ViewPO { | ||
|
||
private _viewFinder = $('app-view-bb9700a6'); | ||
private _linkFinder = this._viewFinder.$('a.e2e-view-link'); | ||
|
||
public async clickLink(pressKey?: string): Promise<void> { | ||
if (pressKey) { | ||
await clickElement(this._linkFinder, pressKey); | ||
} else { | ||
await this._linkFinder.click(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2018-2019 Swiss Federal Railways | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
|
||
import { browser, Key } from 'protractor'; | ||
import { TestcaseBb9700a6ViewPO } from './page-object/testcase-bb9700a6-view.po'; | ||
import { AppPO } from './page-object/app.po'; | ||
import { ViewNavigationPO } from './page-object/view-navigation.po'; | ||
|
||
describe('RouterLink', () => { | ||
|
||
const appPO = new AppPO(); | ||
const viewNavigationPO = new ViewNavigationPO(); | ||
const viewPO = new TestcaseBb9700a6ViewPO(); | ||
|
||
beforeEach(async () => { | ||
await browser.get('/'); | ||
await viewNavigationPO.navigateTo(); | ||
|
||
// open view-bb9700a6 | ||
await viewNavigationPO.enterPath('view-bb9700a6'); | ||
await viewNavigationPO.enterMatrixParams({viewCssClass: 'e2e-view-bb9700a6', viewTitle: 'view-bb9700a6'}); | ||
await viewNavigationPO.selectTarget('self'); | ||
await viewNavigationPO.navigate(); | ||
}); | ||
|
||
it('should open the testing view in current view [testcase: bb9700a6-view]', async () => { | ||
await viewPO.clickLink(); | ||
await expect(appPO.getViewTabCount()).toBe(1); | ||
}); | ||
|
||
it('should open the testing view in new view tab when CTRL + click [testcase: bb9700a6-view]', async () => { | ||
await viewPO.clickLink(Key.CONTROL); | ||
await expect(appPO.getViewTabCount()).toBe(2); | ||
}); | ||
|
||
it('should open the testing view in new view tab when COMMAND + click [testcase: bb9700a6-view]', async () => { | ||
await viewPO.clickLink(Key.COMMAND); | ||
await expect(appPO.getViewTabCount()).toBe(2); | ||
}); | ||
|
||
it('should open the testing view in new view tab when META + click [testcase: bb9700a6-view]', async () => { | ||
await viewPO.clickLink(Key.META); | ||
await expect(appPO.getViewTabCount()).toBe(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.