Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Test Starter #65

Merged
merged 13 commits into from
Nov 14, 2024
Merged

Conversation

maxreichmann
Copy link
Contributor

@maxreichmann maxreichmann commented Oct 30, 2024

Dev Guide explaining Test Starter: https://ui5.sap.com/#/topic/032be2cb2e1d4115af20862673bedcdb

JIRA: CPOUI5FOUNDATION-819

Copy link
Contributor

@margopolo margopolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there indeed no additional resources (e.g. chapters in the documentation) about the test starter?

In general, I believe there is still some explanation needed so beginners can understand and extrapolate from the tutorial to their use cases.

In addition, the link for previewing this step on the github page is not adapted also file test/unit/unitTests-cdn.qunit.html was deleted. I would assume that two additional files (testsuite-cdn.qunit.html and Test-cdn.qunit.hmtl) are still needed to compliment this step.
Also, in the readme we would need a new image (or rather link) for the folder structure, as the current one does not fit anymore.

steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Outdated Show resolved Hide resolved
@maxreichmann maxreichmann marked this pull request as draft October 31, 2024 08:48
@margopolo
Copy link
Contributor

What is the minimum OpenUI5 version required for the test starter?
We currently require version 1.129. If a higher version is necessary, all steps in this tutorial will need to be updated to match the new version.

@maxreichmann
Copy link
Contributor Author

maxreichmann commented Oct 31, 2024

Are there indeed no additional resources (e.g. chapters in the documentation) about the test starter?

In general, I believe there is still some explanation needed so beginners can understand and extrapolate from the tutorial to their use cases.

In addition, the link for previewing this step on the github page is not adapted also file test/unit/unitTests-cdn.qunit.html was deleted. I would assume that two additional files (testsuite-cdn.qunit.html and Test-cdn.qunit.hmtl) are still needed to compliment this step. Also, in the readme we would need a new image (or rather link) for the folder structure, as the current one does not fit anymore.

Regarding additional resources, these Dev Guide chapters could be helpful (and is linked in Step 27)

Regarding the link for previewing this step on the github page: I don't fully understand. How exactly does this preview work? The README.me file can at least be viewed as the compiled markdown code locally.

Regarding the deletion of the two cdn files. I assumed these two files are not necessary anymore with the introduction of the Test Starter.

A new image of the new folder structure is indeed necessary and will be added by UA colleagues.

@maxreichmann maxreichmann force-pushed the use-test-starter branch 2 times, most recently from 1782e0b to ac5f6fa Compare November 7, 2024 09:26
@codeworrior
Copy link

@margopolo AFAIK, minimal version for using it in apps is 1.124.

* test: add CDN testsuite files
* refactor: remove whitespace from legacy HelloDialogFragment.xml + mockserver.html
@matz3 matz3 marked this pull request as ready for review November 7, 2024 15:29
@matz3
Copy link
Contributor

matz3 commented Nov 7, 2024

Now it's ready for review. We'll update the other steps once the content is approved to keep the changes for review as small as possible. Only steps 27 and 28 make changes in the test folder, so it can just be overwritten.

flovogt
flovogt previously approved these changes Nov 8, 2024
Copy link
Member

@flovogt flovogt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LilyanaOviPe could please have a look

@flovogt flovogt requested review from LilyanaOviPe and removed request for codeworrior November 11, 2024 08:45

### Conventions

- All unit tests are placed in the webapp/test/unit folder of the app.

- Files in the test suite end with `*.qunit.html`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add testsuite naming convention (testsuite.*.qunit.js)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -82,34 +85,33 @@ 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 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()`.
This module is the entrypoint for all our unit tests and will be referenced in the test suite that will be created later on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow the explanation about the implementation in the file itself got lost. How about to change the description to:

This module will serve as the entry point for all our unit tests. It will be referenced in the test suite that we will set up later on.

Inside the unitTests.qunit.ts file, we import the unit test for the custom formatter. This ensures that any tests related to the custom formatter functionality will be included when running our unit tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍🏻 I've update it as suggested.

@@ -97,7 +97,11 @@ import "./model/formatter";

### webapp/test/Test.qunit.html \(New\)

We also need a generic test page to run our tests. This is necessary as the namespace of the test code needs to be registered via the `data-sap-ui-resource-roots` attribute. The page will also be referenced in the test suite, which we're going to create next.
We also need a generic test page that will be used to run individual tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have here one additional sentence about the src="../resources/sap/ui/test/starter/runTest.js" script that is initialized in the script tag? Would be good to also mention what this script is for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

margopolo
margopolo previously approved these changes Nov 14, 2024
@matz3
Copy link
Contributor

matz3 commented Nov 14, 2024

Please do not merge yet. I will now update the files in all following steps.

@matz3
Copy link
Contributor

matz3 commented Nov 14, 2024

Ready for final review

@matz3 matz3 merged commit 5d2b193 into SAP-samples:main Nov 14, 2024
3 checks passed
steps/01/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/27/README.md Show resolved Hide resolved
steps/28/README.md Show resolved Hide resolved
@matz3 matz3 mentioned this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants