Skip to content

Commit 1329136

Browse files
Merge pull request #1633 from NativeScript/release-7.0.2
Release 7.0.2
2 parents 851ba1d + 816856f commit 1329136

File tree

40 files changed

+159
-38
lines changed

40 files changed

+159
-38
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="7.0.2"></a>
2+
## [7.0.2](https://github.com/NativeScript/nativescript-angular/compare/7.0.1...7.0.2) (2018-11-26)
3+
4+
5+
### Bug Fixes
6+
7+
* **page-router-outlet:** actionBarVisibility not applied ([#1621](https://github.com/NativeScript/nativescript-angular/issues/1621)) ([a6ff509](https://github.com/NativeScript/nativescript-angular/commit/a6ff509))
8+
* **router-extensions:** unable to go back with relativeTo param ([#1632](https://github.com/NativeScript/nativescript-angular/issues/1632)) ([63900dc](https://github.com/NativeScript/nativescript-angular/commit/63900dc))
9+
10+
11+
112
<a name="7.0.1"></a>
213
## [7.0.1](https://github.com/NativeScript/nativescript-angular/compare/7.0.0...7.0.1) (2018-11-20)
314

e2e/modal-navigation-ng/e2e/screens/screen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Screen {
4444
}
4545

4646
loadedHome = async () => {
47-
const lblHome = await this._driver.findElementByAutomationText(home);
47+
const lblHome = await this._driver.waitForElement(home);
4848
assert.isTrue(await lblHome.isDisplayed());
4949
console.log(home + " loaded!");
5050
}
@@ -149,7 +149,7 @@ export class Screen {
149149
}
150150

151151
loadedModalFrame = async () => {
152-
const lblModal = await this._driver.findElementByAutomationText(modal, 1000);
152+
const lblModal = await this._driver.waitForElement(modal, 5000);
153153
assert.isTrue(await lblModal.isDisplayed(), `${modal} is not displayed!`);
154154
console.log(modal + " loaded!");
155155
}
@@ -226,7 +226,7 @@ export class Screen {
226226
}
227227

228228
loadedSecondPage = async () => {
229-
const lblModalSecond = await this._driver.findElementByAutomationText(modalSecond);
229+
const lblModalSecond = await this._driver.waitForElement(modalSecond, 5000);
230230
assert.isTrue(await lblModalSecond.isDisplayed());
231231
console.log(modalSecond + " loaded!");
232232
}
@@ -259,7 +259,7 @@ export class Screen {
259259
}
260260

261261
loadedNestedModalFrame = async () => {
262-
const lblModalNested = await this._driver.findElementByAutomationText(modalNested);
262+
const lblModalNested = await this._driver.waitForElement(modalNested, 5000);
263263
assert.isTrue(await lblModalNested.isDisplayed());
264264
console.log(modalNested + " loaded!");
265265
}

e2e/renderer/app/app-routing.module.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2-
import { NativeScriptRouterModule } from "nativescript-angular/router";
2+
import { NativeScriptRouterModule, NSEmptyOutletComponent } from "nativescript-angular/router";
33

44
import { ActionBarDynamicItemsComponent } from "./action-bar/action-bar-dynamic-items.component";
55
import { ActionBarExtensionComponent } from "./action-bar/action-bar-extension.component";
@@ -54,6 +54,16 @@ export const routes = [
5454
component: NestedPageComponent
5555
}]
5656
},
57+
{
58+
path: "action-bar-visibility-never-lazy",
59+
component: ActionBarVisibilityNeverComponent,
60+
children: [{
61+
path: "nested",
62+
outlet: "nested",
63+
component: NSEmptyOutletComponent,
64+
loadChildren:"~/page-router-outlet/nested-lazy-page.module#NestedLazyPageModule"
65+
}]
66+
},
5767
{
5868
path: "action-bar-dynamic",
5969
component: ActionBarDynamicItemsComponent,
@@ -111,7 +121,6 @@ export const navigatableComponents = [
111121
ActionBarVisibilityAlwaysComponent,
112122
ActionBarVisibilityNeverComponent,
113123
ActionBarVisibilityAutoComponent,
114-
NestedPageComponent,
115124

116125
TabItemBindingComponent,
117126

e2e/renderer/app/app.module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { ItemsService } from "./items.service";
1111

1212
import { rendererTraceCategory, viewUtilCategory, bootstrapCategory } from "nativescript-angular/trace";
1313
import { addCategories, enable, categories } from "tns-core-modules/trace";
14+
import { SharedModule } from "./shared.module";
15+
1416
addCategories(bootstrapCategory);
1517
addCategories(rendererTraceCategory);
1618
addCategories(viewUtilCategory);
@@ -22,7 +24,7 @@ export class MyErrorHandler implements ErrorHandler {
2224
console.log("### ErrorHandler Error: " + error.toString());
2325
console.log("### ErrorHandler Stack: " + error.stack);
2426
}
25-
}
27+
}
2628

2729

2830
@NgModule({
@@ -38,6 +40,7 @@ export class MyErrorHandler implements ErrorHandler {
3840
imports: [
3941
NativeScriptModule,
4042
AppRoutingModule,
43+
SharedModule
4144
],
4245
schemas: [NO_ERRORS_SCHEMA],
4346
})

e2e/renderer/app/list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Component } from "@angular/core";
99
<Button text="ActionBarVisibility Always" [nsRouterLink]="['/action-bar-visibility-always']"></Button>
1010
<Button text="ActionBarVisibility Never" [nsRouterLink]="['/action-bar-visibility-never']"></Button>
1111
<Button text="ActionBarVisibility Auto" [nsRouterLink]="['/action-bar-visibility-auto']"></Button>
12+
<Button text="ActionBarVisibility Never Lazy" [nsRouterLink]="['/action-bar-visibility-never-lazy']"></Button>
1213
<Button text="TabItem Binding" [nsRouterLink]="['/tab-item-binding']"></Button>
1314
<Button text="NgFor" [nsRouterLink]="['/ngfor']"></Button>
1415
<Button text="NgForOf" [nsRouterLink]="['/ngforof']"></Button>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2+
import { NativeScriptRouterModule } from "nativescript-angular/router";
3+
import { NativeScriptCommonModule } from "nativescript-angular/common";
4+
import { SharedModule } from "~/shared.module";
5+
import { NestedPageComponent } from "./nested-page.component";
6+
7+
@NgModule({
8+
imports: [
9+
SharedModule,
10+
NativeScriptCommonModule,
11+
NativeScriptRouterModule,
12+
NativeScriptRouterModule.forChild([
13+
{ path: "", component: NestedPageComponent }
14+
])
15+
],
16+
providers: [
17+
],
18+
schemas: [NO_ERRORS_SCHEMA]
19+
})
20+
export class NestedLazyPageModule { }

e2e/renderer/app/shared.module.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2+
import { NativeScriptRouterModule } from "nativescript-angular/router";
3+
import { NativeScriptCommonModule } from "nativescript-angular/common";
4+
import { NestedPageComponent } from "./page-router-outlet/nested-page.component";
5+
6+
@NgModule({
7+
imports: [
8+
NativeScriptCommonModule,
9+
NativeScriptRouterModule
10+
],
11+
declarations:[NestedPageComponent],
12+
schemas: [NO_ERRORS_SCHEMA]
13+
})
14+
export class SharedModule { }

e2e/renderer/e2e/action-bar.e2e-spec.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from "nativescript-dev-appium";
77

88
import { isOnTheLeft } from "./helpers/location";
9+
import { assert } from "chai";
910

1011
describe("Action Bar scenario", () => {
1112
let driver: AppiumDriver;
@@ -132,16 +133,10 @@ describe("Action Bar scenario", () => {
132133
conditional = await driver.findElementByAutomationText("conditional");
133134
});
134135

135-
it("should detach conditional action item when its condition is false", done => {
136-
(async () => {
137-
await toggle();
138-
139-
try {
140-
await driver.findElementByAutomationText("conditional");
141-
} catch (e) {
142-
done();
143-
}
144-
})();
136+
it("should detach conditional action item when its condition is false", async () => {
137+
await toggle();
138+
const conditionalBtn = await driver.waitForElement("conditional", 1000);
139+
assert.isUndefined(conditionalBtn, "Conditional button should not be visible!");
145140
});
146141

147142
it("should reattach conditional action item at correct place", async () => {

e2e/renderer/e2e/page-router-outlet.e2e-spec.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,52 @@ describe("page-router-outlet-scenario", () => {
9393
});
9494
});
9595

96+
describe("actionBarVisibility 'never' doesn't show action bars in lazy module page", async () => {
97+
let imagePostFix = "";
98+
before(async () => {
99+
driver = await createDriver();
100+
await driver.driver.resetApp();
101+
if (driver.isIOS && driver.nsCapabilities.device.name.toLowerCase().includes("x")) {
102+
imagePostFix = "-lazy";
103+
}
104+
});
105+
106+
afterEach(async function () {
107+
if (this.currentTest.state === "failed") {
108+
await driver.logTestArtifacts(this.currentTest.title);
109+
}
110+
});
111+
112+
it("should navigate to page", async () => {
113+
const navigationButton =
114+
await driver.findElementByAutomationText("ActionBarVisibility Never Lazy");
115+
await navigationButton.click();
116+
117+
await driver.findElementByAutomationText("ShowActionBar");
118+
});
119+
120+
it("should hide action bar by default", async () => {
121+
const screenMatches = await driver.compareScreen(`actionBarVisibility-never-default${imagePostFix}`, 5);
122+
assert(screenMatches);
123+
});
124+
125+
it("should not show action bar when shown by page", async () => {
126+
const showActionBarButton = await driver.findElementByAutomationText("ShowActionBar");
127+
showActionBarButton.click();
128+
129+
const screenMatches = await driver.compareScreen(`actionBarVisibility-never-shown${imagePostFix}`, 5);
130+
assert(screenMatches);
131+
});
132+
133+
it("should not do anything when hidden action bar by page", async () => {
134+
const hideActionBarButton = await driver.findElementByAutomationText("HideActionBar");
135+
hideActionBarButton.click();
136+
137+
const screenMatches = await driver.compareScreen(`actionBarVisibility-never-hidden${imagePostFix}`, 5);
138+
assert(screenMatches);
139+
});
140+
});
141+
96142
describe("actionBarVisibility 'auto' shows action bars based on page", async () => {
97143
before(async () => {
98144
driver = await createDriver();
220 KB
Loading

0 commit comments

Comments
 (0)