Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions steps/27/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ QUnit.test("Should return the translated texts", (assert) => {
### webapp/test/unit/unitTests.qunit.ts \(New\)

We create a new `unitTests.qunit.ts` file under `webapp/test/unit/`.
This script loads and executes our formatter.
This script loads and executes our formatter test. Before the QUnit test execution can be started we need to wait until the Core has been booted. Therefore, you need to disable the autostart `QUnit.config.autostart = false;`, require the `sap/ui/core/Core` module and use `Core.ready()` to wait until the Core has booted and then you can start the QUnit tests with `QUnit.start()`.

```ts
/* @sapUiRequire */
QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
```
Expand Down
5 changes: 3 additions & 2 deletions steps/27/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
12 changes: 6 additions & 6 deletions steps/28/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ As you can see, the test case reads like a user story, we actually do not need t

We create a new `opaTests.qunit.ts` file under `webapp/test/integration/`.

We instruct QUnit to wait longer, allowing us to load our test files asynchronously. Then, we load the `NavigationJourney`, and execute the test functions inside immediately.
This script loads and executes our `NavigationJourney`. Before the QUnit test execution can be started we need to wait until the Core has been booted. Therefore, you need to disable the autostart `QUnit.config.autostart = false;`, require the `sap/ui/core/Core` module and use `Core.ready()` to wait until the Core has booted and then you can start the QUnit tests with `QUnit.start()`.

```ts

/* @sapUiRequire */
QUnit.config.autostart = false;

// import all your OPA tests here
// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});

```

***
Expand Down
5 changes: 3 additions & 2 deletions steps/28/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/28/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/29/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/29/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/30/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/30/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/31/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/31/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/32/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/32/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/33/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/33/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/34/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/34/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/35/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/35/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/36/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/36/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/37/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/37/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/38/webapp/test/integration/opaTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your integration tests here
void Promise.all([
import("ui5/walkthrough/test/integration/NavigationJourney")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/integration/NavigationJourney"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});
5 changes: 3 additions & 2 deletions steps/38/webapp/test/unit/unitTests.qunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ QUnit.config.autostart = false;

// import all your QUnit tests here
void Promise.all([
import("ui5/walkthrough/test/unit/model/formatter")
]).then(() => {
import("sap/ui/core/Core"), // required to wait until Core has booted to start the QUnit tests
import("ui5/walkthrough/test/unit/model/formatter"),
]).then(([{default: Core}]) => Core.ready()).then(() => {
QUnit.start();
});