Posts

Showing posts from December, 2024

Docker Desktop

Image
 To run and shut down docker desktop: Once docker has started, key in the URL into the web browser

Cypress, Cucumber/Gherkin

Image
 To use cypress, we need to use Visual Studio code IDE. Create new folder in the repo folder: VS code > open folder > find the just created folder Terminal > New terminal To initialise project: Just press enter. If all ok, type in yes. Installing cypress To install with specific version, add @^xx.x.x To open cypress: Click E2E testing: Once the initial configuration is completed, go back to VS code. Cypress > add a new folder within the cypress folder and name it "integration". Within integration folder, create a new javascript file (.js extension) To let Cypress know where it can find out tests, go to cypress config js file and type below command and save:  Cypress will recognise all js file in integration folder as Tests. Then write the test in the js file. Sample: Save and run in the cypress browser. To find an element via cypress, click on the locator button and then the specific element that we want. From there you can just copy the code that has been prepare...

Load/performancing testing part 2 - using dynamic data variable

Image
 Performance testing with body data: Body data would be the json body of the request. Below is to tell Jmeter the content type Click add. Name and value to follow the key and value type in API request To put dynamic data for performance test, create data in notepad and save it in load test folder (to save file as csv) Go back to Jmeter and go to config element And browse from there - ensure to select "ignore first line" option to true Changes need to be made under HTTP request to be able to use a dynamic variable

Load/performance testing

Image
 Examples of performance testing test cases: 1. Check if 100 users are able to upload videos with size of 5MB within 1 min 2. Check if 200 users are able to watch the video within 1 min 3.Check if 50 users are able to delete a video within 1 min ------- Client side metrics KPIs 1. Response time 2. Throughput 3. 90 percentile 4. 95 percentile 5. 99 percentile 6. Error % 7. Min 8. Max 9. Avg Server side metrics 1. CPU 2. Memory 3. Cache 4. Disk Tools for performance testing: 1. Jmeter To access jmeter: To perform performance testing in jmeter: Basically, assertions are what you want to test and verify This is to add a report. Can choose any type of report available: Fill in variables in the thread group: **Commit all changes to via GitGui or GitBash. But files must be saved in the correct Git folder**

Newman - to run API tests

Image
If you want to run API tests without using Postman, you can use Newman. Using newman is useful when you are in CI/CD pipeline as it is impossible to open Postman from there. So we can just pass the newman script to devOps to execute the tests. Before installing Newman, need to install Node.js To confirm that Node js and newman was successfully installed  To install Newman extension (for report generation) Using Newman to execute test where highlighted portion is the collection name and underlined portion is the environment name (can just type initial letter and then press "tab" button) Sample outcome: To execute test and generating report (where underlined is script for report generation): The report will be available in the folder where this command was run. Sample HTML report: To give title to the report: