You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -73,11 +74,21 @@ The following software are required:
73
74
https://nodejs.org/en/download/
74
75
```
75
76
- Install Java 8 or above, Allure Reports require Java 8 or higher.
76
-
77
+
- Install Java 11 instead of Java 8 if you intend to use Sonar Qube.
77
78
- allure commandline : Install allure command line for generating Allure Reports using
78
79
```sh
79
80
npm install -g allure-commandline
80
81
```
82
+
- If you wish to include SonarQube follow the below steps:
83
+
- Install Java 11 and add java path to "PATH" environment variable.
84
+
- Download SonarQube community server from the below url and unzip it to desired location.
85
+
```sh
86
+
https://www.sonarqube.org/downloads/
87
+
```
88
+
- Download Sonar Scanner for your desired OS (Windows in my case) from below location and unzip it to desired location. Then navigate to bin location once unzipped and provide the path to "PATH" environment variable.
Once you have completed setup for SonarQube given in Prerequisites section, configure SonarQube as given below
195
+
- Go to the path where sonarqube server(For e.g. : C:\SonarQube\sonarqube-9.1.0.47736) is unzipped -> Go to conf Folder -> open sonar.properties file and add the below prperties and save the file, you can give any port you wish I have used port 9000.
196
+
```JS
197
+
sonar.host.url=http://localhost:9000
198
+
sonar.sourceEncoding=UTF-8
199
+
```
200
+
- Go to the path where sonarqube server(For e.g. : C:\SonarQube\sonarqube-9.1.0.47736) is unzipped -> Go to bin section -> Go to the folder as per the OS you are using , in my case windows-x86-64 -> Double click on Start Sonar and wait for it to display SonarQube is up (you might encounter some java errors but its fine don't close the terminal).
201
+
- Go to the browser and naigate to http://localhost:9000 , default username is `admin`, default password is `admin`. It might ask you to provide a new password for if you have logged in for first time, I have changed default password to `password`.
202
+
- In your working project (playwright-typescipt-playwright-test), navigate to `sonar-project.properties` file and provide the credentials configured on server webpage username value in `sonar.login` and password in `sonar.password`, in my case username is `admin` and password was changed to `password`.
203
+
```JS
204
+
sonar.login=admin
205
+
sonar.password=password
206
+
```
207
+
- You can provide any project name in `sonar.projectKey`.
208
+
- Specify a version in `sonar.projectVersion`.
209
+
- Provide `UTF-8` in `sonar.sourceEncoding`.
210
+
- In `sonar.language` provide the language you want to run scan on (For e.g. for typescipt its ts and for javascript its js).
211
+
- If you have eslint file in your project provide the location in `sonar.eslint.eslintconfigpath`.
212
+
- You can exclude file from scanning like node_modules, results , Downloads section in `sonar.exclusions`.
213
+
- You can give your project location in `sonar.sources` section I have provided it as `./` because my `sonar-project.properties` file is within my project. If your properties files is somewhere else you have to provide the complete project path.
214
+
- Now go to the location where `sonar-project.properties` is present and run `sonar-scanner` command (In my case I will diectly run it inside my project), and wait for scan to get over with success message.
215
+
- Now navigate to `http://localhost:9000/` and click on your project key displayed and go to Issues section, you can find all the suggestions and issues here. You can fix the issues ans rerun `sonar-scanner` command once again.
0 commit comments