-
Couldn't load subscription status.
- Fork 506
Documentation of Web app unit Test #2218
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
base: master
Are you sure you want to change the base?
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Tizen Web Application Unit Test | ||
|
|
||
| > **[NOTE]** | ||
| > | ||
| > Before running the **Web Unit Test**, make sure: | ||
| > - You have an **Emulator** or a connected **target device** running. | ||
| > - If you don’t have a web application project to test, you can create one using the **Project Wizard** with a template or sample project. | ||
| > For more details, see [Web Application Development](../Tizen/web.md). | ||
| --- | ||
|
|
||
| ## Configuring a Web App for Web Test | ||
|
|
||
| ### Step 1: Create a Tizen Web Unit Test | ||
| 1. In **Visual Studio**, right-click on your **Web project name**. | ||
| 2. Select **Create Tizen Web Unit Test**. | ||
| 3. Choose the **.js** file where your test cases are written. | ||
| 4. Select the test cases you want to include. | ||
| 5. *(Optional)* Choose **Create Setup** or **Create Teardown** if needed. | ||
| 6. Enter a name for the test file and click **OK**. | ||
|
|
||
|  | ||
|
|
||
|  | ||
| --- | ||
|
|
||
| ### Step 2: Modify the Generated Test File | ||
| - A folder named **`webunittest`** will be created in your project. | ||
| - Inside this folder, a file named **`tests/mainTests.js`** (or your chosen test file name) will be automatically generated. | ||
| - Modify this file to define or customize your test cases as needed. | ||
|
|
||
|  | ||
| --- | ||
|
|
||
| ### Step 3: Run the Tizen Web Unit Test | ||
| 1. Right-click again on your **Web project name**. | ||
| 2. Select **Run Tizen Web Unit Test**. | ||
| 3. The test will execute on your selected emulator or connected device. | ||
| 4. Once complete, the test results will be displayed in the output window in a tree format. It shows the passed tests with a green icon and failed tests with a red icon. Upon double click on the failed test case, the cursor will navigate to the line of the failed testcase. | ||
|  | ||
| --- | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,40 @@ | ||
| # Unit Test with Code Coverage | ||
|
|
||
| The Code Coverage is a profiling tool used to determine the coverage details of Tizen Native Applications. It helps you to understand the code quality of your application. The Code Coverage tool finds the parts of the code covered during the execution of the unit test cases. A program with high code coverage (measured in percentage) implies that most of the source code is covered during testing, and the source code has a lower chance of containing undetected software bugs. | ||
| **Code Coverage** is a profiling tool used to measure how much of your application's source code is executed while running unit tests. It helps evaluate **code quality** and identify untested parts of your codebase. | ||
|
|
||
| The code coverage tool in the Tizen Extension for Visual Studio is based on the `llvm-cov` tool. Using the Code Coverage tool, you can detect parts of code that are not covered by a unit test, and ensure that the uncovered code does not cause errors at runtime. The Code Coverage tool supports functional, statement, and branch coverage. | ||
| A higher coverage percentage indicates that most of your source code has been tested, which reduces the likelihood of undetected software bugs. By using **Unit Tests**, you can verify the correctness of your code, improve reliability, and maintain high software quality. | ||
|
|
||
| With a Unit Test, you can verify that your code works well, and increases its reliability. Tizen Studio Extension for VS provides the creating, building, and editing tools for unit tests, and a view for checking and analyzing the test results. | ||
| It uses the `gtest` framework to make and launch the test cases. To manage your test cases, you can use the test explorer view. | ||
| The **Tizen Studio Extension for Visual Studio** provides tools for: | ||
| - Creating, building, and editing unit tests | ||
| - Running and analyzing test results | ||
| - Measuring and visualizing code coverage | ||
|
|
||
| Get started with [Unit test code coverage information of native application on VS](../getting-started/test-profile-app-unit-test-code-coverage.md) | ||
| --- | ||
|
|
||
| ## Native Application | ||
|
|
||
| For **Native Applications**, the Code Coverage feature in the **Tizen Extension for Visual Studio** is powered by the **`llvm-cov`** tool. | ||
| It helps you: | ||
| - Detect code segments that are not covered by unit tests | ||
| - Ensure that uncovered code does not cause runtime issues | ||
| - Measure different types of coverage: | ||
| - **Functional coverage** | ||
| - **Statement coverage** | ||
| - **Branch coverage** | ||
|
|
||
| The extension uses the **Google Test (gtest)** framework to create and execute test cases. | ||
|
|
||
| > Get started with [Unit Test With Code Coverage for Native Applications on Visual Studio](../getting-started/test-profile-app-unit-test-code-coverage.md) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the get started with like before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation has changed to the right, check why? |
||
|
|
||
| --- | ||
|
|
||
| ## Web Application | ||
|
|
||
| For **Web Applications**, you can also create and run unit tests within the **Tizen Extension for Visual Studio**. | ||
| These tools allow you to: | ||
| - Write test cases for web projects | ||
| - Execute them on an emulator or target device | ||
| - View and analyze test results directly in Visual Studio | ||
|
|
||
| > Get started with [Unit Test for Web Applications on Visual Studio](../getting-started/web-app-unit-test.md) | ||
| --- | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double click after opening the dropdown of failed testcase