Merge branch 'master' of ssh.dev.azure.com:v3/Foster-X/CMP329%20CW2/CMP329%20CW2

This commit is contained in:
Xander 2025-04-08 15:11:21 +01:00
commit e9f0176e4c
3 changed files with 18 additions and 2 deletions

View file

@ -0,0 +1,4 @@
Role,Username,Step,Result
N/A,testuser,Login,PASS
N/A,subscriber,Login,PASS
N/A,fakename,Login,FAIL
1 Role Username Step Result
2 N/A testuser Login PASS
3 N/A subscriber Login PASS
4 N/A fakename Login FAIL

View file

@ -0,0 +1,12 @@
Role,Username,Step,Result
author,testuser,Login,PASS (Logged in succesfully)
author,testuser,Post Access,PASS
author,testuser,Post Creation,PASS
author,testuser,Post Visible,PASS
author,testuser,Post Deleted,PASS
subscriber,subscriber,Login,PASS (Logged in succesfully)
subscriber,subscriber,Post Access,PASS
subscriber,subscriber,Post Creation,SKIPPED (Not permitted)
subscriber,subscriber,Post Visible,SKIPPED
subscriber,subscriber,Post Deleted,SKIPPED
unauthorised,fakename,Login,PASS (Login failed, as expected)
Can't render this file because it has a wrong number of fields in line 12.

View file

@ -33,7 +33,7 @@ public class TestPoster {
@BeforeAll @BeforeAll
public static void initReport() { public static void initReport() {
CsvBuilder.createTestReportFile(); CsvBuilder.createTestReportFile();
} }
@ParameterizedTest @ParameterizedTest
@ -50,7 +50,7 @@ public class TestPoster {
boolean loginAllowed = (!role.equals("unauthorised")); boolean loginAllowed = (!role.equals("unauthorised"));
WebElement username = driver.findElement(By.id(USERNAME_BOX_ID)); WebElement username = driver.findElement(By.id(USERNAME_BOX_ID));
WebElement password = driver.findElement(By.id(PASSWORD_BOX_ID)); WebElement password = driver.findElement(By.id(PASSWORD_BOX_ID));
WebElement login = driver.findElement(By.id(LOGIN_BUTTON_ID)); WebElement login= driver.findElement(By.id(LOGIN_BUTTON_ID));
username.sendKeys(usernameText); username.sendKeys(usernameText);
password.sendKeys(passwordText); password.sendKeys(passwordText);