skyline/docs/en/test/2-catalog-introduction.md
wuduochao 8f071a29ab docs: Add en test docs
Add en test docs

Change-Id: I821261620dff17738999883ab0323cd616a8ffe6
2021-07-05 14:37:29 +08:00

92 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

English | [简体中文](/docs/zh/test/2-catalog-introduction.md)
```
test
├── e2e E2E code storage location
│ ├── config
│ │ ├── config.yaml (Part of the configuration when E2E running, mainly configures the test case file list, login account and other information)
│ │ └── local_config.yaml (Part of the configuration when E2E running, mainly configures the test case file list, login account and other information, which is gitignore and has a higher priority than config.yaml)
│ ├── fixtures (Store upload files, read files, etc. required during operation)
│ │ ├── keypair (Test file read by key)
│ │ ├── metadata.json (Test metadata read file)
│ │ ├── stack-content.yaml (Files read by the test stack)
│ │ └── stack-params.yaml (Files read by the test stack)
│ ├── integration (Storage unit test)
│ │ └── pages (Adjust the directory according to the webpage menu structure)
│ │ ├── compute (compute)
│ │ │ ├── aggregate.spec.js (aggregate)
│ │ │ ├── baremetal.spec.js (baremetal)
│ │ │ ├── flavor.spec.js (instance flavor)
│ │ │ ├── hypervisor.spec.js (hypervisor)
│ │ │ ├── image.spec.js (image)
│ │ │ ├── instance.spec.js (instance)
│ │ │ ├── ironic.spec.js (ironic)
│ │ │ ├── keypair.spec.js (keypair)
│ │ │ └── server-group.spec.js (server group)
│ │ ├── configuration (Platform configuration)
│ │ │ ├── metadata.spec.js (metedata)
│ │ │ └── system.spec.js (system info)
│ │ ├── error.spec.js (error page)
│ │ ├── heat (heat)
│ │ │ └── stack.spec.js (stack)
│ │ ├── identity (identity)
│ │ │ ├── domain.spec.js (Domain)
│ │ │ ├── project.spec.js (Project)
│ │ │ ├── role.spec.js (Role)
│ │ │ ├── user-group.spec.js (User group)
│ │ │ └── user.spec.js (User)
│ │ ├── login.spec.js (Login)
│ │ ├── management (Operation management)
│ │ │ └── recycle-bin.spec.js (Recycle)
│ │ ├── network (Network)
│ │ │ ├── floatingip.spec.js (Floating ip)
│ │ │ ├── lb.spec.js (Loadbalance)
│ │ │ ├── network.spec.js (Network)
│ │ │ ├── qos-policy.spec.js (Qos policy)
│ │ │ ├── router.spec.js (Router)
│ │ │ ├── security-group.spec.js (Security group)
│ │ │ ├── topology.spec.js (Network topology)
│ │ │ ├── virtual-adapter.spec.js (Virtual Adapter)
│ │ │ └── vpn.spec.js (VPN)
│ │ └── storage (Storage)
│ │ ├── backup.spec.js (Backup)
│ │ ├── qos.spec.js (QoS)
│ │ ├── snapshot.spec.js (Volume snapshot)
│ │ ├── storage.spec.js (Storage)
│ │ ├── volume-type.spec.js (Volume tyoe)
│ │ └── volume.spec.js (Volume)
│ ├── plugins (Cypress plugins)
│ │ └── index.js (Configured to read the configuration file, configured to use the code coverage function)
│ ├── report (Store E2E test report)
│ │ ├── merge-report.html (The final test report that records the execution of each use case)
│ │ └── merge-report.json (Summary of test results in the results directory)
│ ├── results (Store test result files)
│ ├── screenshots (Store a snapshot of the test error)
│ ├── support (When writing a test case, double-wrapped function)
│ │ ├── commands.js (Storage login, logout and other operation functions)
│ │ ├── common.js (Storage base functions)
│ │ ├── constants.js (Storage the route of each resource)
│ │ ├── detail-commands.js (Storage the functions related to the resource detail page, based on the framework, the operation of the detail page is consistent)
│ │ ├── form-commands.js (Stores form-related functions, based on the framework, consistent with the operation of form items)
│ │ ├── index.js
│ │ ├── resource-commands.js (Storage functions related to resource operations, such as creating cloud hosts, creating routes, deleting resources, etc.)
│ │ └── table-commands.js (Storage the functions related to the resource list, based on the framework, have consistency in the operation of the list)
│ └── utils (Store the read function for the configuration file)
│ └── index.js
└── unit (Unit test)
├── local-storage-mock.js ( Storeage mock function in local)
├── locales (Translation files used when testing internationalization)
│ ├── en-US.js
│ └── zh-CN.js
├── setup-tests.js (setup uni test)
└── svg-mock.js (Mock of image loading)
```
- E2E test code, storaged in the `test/e2e` directory
- Other global configurations of E2E storaged in `cypress.json`
- The basic code of the unit test storaged in the `test/unit` directory
- Other global configuration of unit test, storaged in `jest.config.js`
- The test code of the unit test is usually placed in the same directory as the file to be tested, and has a suffix of `test.js` or `spec.js`
- case`src/utils/index.js`与`src/utils/index.test.js`
- case`src/utils/local-storage.js`与`src/utils/local-storage.spec.js`