diff --git a/docs/testing-deliverables/task-1/formal_review.pdf b/docs/testing-deliverables/task-1/formal_review.pdf new file mode 100644 index 0000000..54ede10 Binary files /dev/null and b/docs/testing-deliverables/task-1/formal_review.pdf differ diff --git a/docs/testing-deliverables/task-1/srs.pdf b/docs/testing-deliverables/task-1/srs.pdf new file mode 100644 index 0000000..b4d2a56 Binary files /dev/null and b/docs/testing-deliverables/task-1/srs.pdf differ diff --git a/docs/testing-deliverables/task-2/risk-management.pdf b/docs/testing-deliverables/task-2/risk-management.pdf new file mode 100644 index 0000000..14c5aea Binary files /dev/null and b/docs/testing-deliverables/task-2/risk-management.pdf differ diff --git a/docs/testing-deliverables/task-3/black-box-test-design.pdf b/docs/testing-deliverables/task-3/black-box-test-design.pdf new file mode 100644 index 0000000..c33a06c Binary files /dev/null and b/docs/testing-deliverables/task-3/black-box-test-design.pdf differ diff --git a/docs/testing-deliverables/task-4/white-box-testing.pdf b/docs/testing-deliverables/task-4/white-box-testing.pdf new file mode 100644 index 0000000..27d1539 Binary files /dev/null and b/docs/testing-deliverables/task-4/white-box-testing.pdf differ diff --git a/docs/testing-deliverables/task-5/testing-backend.zip b/docs/testing-deliverables/task-5/testing-backend.zip new file mode 100644 index 0000000..090e9f5 Binary files /dev/null and b/docs/testing-deliverables/task-5/testing-backend.zip differ diff --git a/docs/testing-deliverables/task-5/testing-frontend.zip b/docs/testing-deliverables/task-5/testing-frontend.zip new file mode 100644 index 0000000..c63673c Binary files /dev/null and b/docs/testing-deliverables/task-5/testing-frontend.zip differ diff --git a/docs/testing-deliverables/task-6/backend/config.yml b/docs/testing-deliverables/task-6/backend/config.yml new file mode 100644 index 0000000..89e51e1 --- /dev/null +++ b/docs/testing-deliverables/task-6/backend/config.yml @@ -0,0 +1,40 @@ +version: 2 +jobs: + build: + docker: + # using custom image, see .circleci/images/primary/Dockerfile + - image: circleci/cci-demo-docker-primary:0.0.2 + working_directory: /src/ + + + environment: + TEST_RESULTS: /tmp/test-results + + steps: + - checkout + - setup_remote_docker + + # This should go into custom primary image, here's only for the sake of explanation + - run: + name: Install Docker client + command: | + set -x + VER="17.03.0-ce" + curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz + tar -xz -C /tmp -f /tmp/docker-$VER.tgz + mv /tmp/docker/* /usr/bin + + # This should go into custom primary image, here's only for the sake of explanation + - run: + name: Install Docker Compose + command: | + set -x + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose + + + - run: + name: Start container and run test + command: | + set -x + docker-compose up test --build --exit-code-from test \ No newline at end of file diff --git a/docs/testing-deliverables/task-6/backend/output.txt b/docs/testing-deliverables/task-6/backend/output.txt new file mode 100644 index 0000000..190fae6 --- /dev/null +++ b/docs/testing-deliverables/task-6/backend/output.txt @@ -0,0 +1,5 @@ ++ docker-compose up test --build --exit-code-from test +ERROR: The Compose file './docker-compose.yml' is invalid because: +services.test.depends_on contains an invalid type, it should be an array + +Exited with code exit status 1 \ No newline at end of file diff --git a/docs/testing-deliverables/task-6/frontend/config.yml b/docs/testing-deliverables/task-6/frontend/config.yml new file mode 100644 index 0000000..9954322 --- /dev/null +++ b/docs/testing-deliverables/task-6/frontend/config.yml @@ -0,0 +1,22 @@ +version: 2.1 + +orbs: + node: circleci/node@4.7 + +jobs: + build-and-test: + docker: + - image: cimg/node:16.10 + steps: + - checkout + - node/install-packages: + pkg-manager: yarn + - run: + name: Run tests + command: yarn test + +workflows: + sample: + jobs: + - build-and-test + \ No newline at end of file diff --git a/docs/testing-deliverables/task-6/frontend/output.txt b/docs/testing-deliverables/task-6/frontend/output.txt new file mode 100644 index 0000000..dd924e4 --- /dev/null +++ b/docs/testing-deliverables/task-6/frontend/output.txt @@ -0,0 +1,38 @@ +yarn run v1.22.11 +$ react-scripts test + PASS src/layout/login-page/login-success/LoginSuccess.test.tsx (10.601 s) + PASS src/utils/CryptoUtils.test.ts (11.794 s) + PASS src/layout/central-layout/CentralLayout.test.tsx (17.202 s) + PASS src/layout/navigation-bar/roll-call-navigation-bar/RollCallNavigationBar.test.tsx (17.398 s) + PASS src/components/loading-table/LoadingTable.test.tsx (17.29 s) + PASS src/layout/not-found-page/NotFoundPage.test.tsx (17.206 s) + PASS src/layout/navigation-bar/student-navigation-bar/StudentNavigationBar.test.tsx (17.885 s) + PASS src/layout/navigation-bar/default-navigation-bar/DefaultNavigationBar.test.tsx (18 s) + PASS src/components/primary-button/PrimaryButton.test.tsx (17.793 s) + PASS src/components/main-card/MainCard.test.tsx (17.806 s) + PASS src/components/table-row/TableRow.test.tsx (18.003 s) + PASS src/components/subject-table/SubjectTable.test.tsx (17.913 s) + PASS src/layout/navigation-bar/teacher-navigation-bar/TeacherNavigationBar.test.tsx (17.992 s) + PASS src/components/logout-button/LogoutButton.test.tsx (18.116 s) + PASS src/layout/login-page/LoginPage.test.tsx (18.2 s) + PASS src/components/search-input/SearchInput.test.tsx (18.198 s) + PASS src/provider/UserProvider.test.tsx (18.309 s) + PASS src/layout/navigation-bar/authorized-navigation-bar/AuthorizedNavigationBar.test.tsx (18.408 s) + PASS src/layout/student-homepage/StudentHomepage.test.tsx (18.514 s) + PASS src/layout/attendance-page/AttendancePage.test.tsx (18.7 s) + PASS src/layout/navigation-bar/navigation-bar-link/NavigationBarLink.test.tsx (18.622 s) + PASS src/components/attend-to-class/attend-to-class-form/AttendToClassForm.test.tsx (18.92 s) + PASS src/layout/attendance-page/attendanceView/AttendanceView.test.tsx (18.822 s) + PASS src/App.test.tsx (18.822 s) + PASS src/layout/attendance-page/attendanceView/AttendanceCode/AttendanceCode.test.tsx (19.034 s) + PASS src/route/SwitchGuard.test.tsx (18.767 s) + PASS src/layout/lecture-code-accepted-modal/LecutureCodeAcceptedModal.test.tsx (19.085 s) + PASS src/components/attend-to-class/AttendToClass.test.tsx (19.687 s) + PASS src/layout/teacher-subject-management/TeacherSubjectManagement.test.tsx (20.137 s) + +Test Suites: 29 passed, 29 total +Tests: 63 passed, 63 total +Snapshots: 0 total +Time: 26.891 s +Ran all test suites. +Done in 28.36s. \ No newline at end of file diff --git a/docs/testing-deliverables/task-7/end-to-end.spec.js b/docs/testing-deliverables/task-7/end-to-end.spec.js new file mode 100644 index 0000000..10b23d7 --- /dev/null +++ b/docs/testing-deliverables/task-7/end-to-end.spec.js @@ -0,0 +1,298 @@ +// Generated by Selenium IDE +require("dotenv").config(); +const assert = require("assert"); +const { Builder, By } = require("selenium-webdriver"); + +// Constants +const STUDENT_USER = process.env.SELENIUM_STUDENT_USER || ""; +const STUDENT_PASS = process.env.SELENIUM_STUDENT_PASS || ""; +const TEACHER_USER = process.env.SELENIUM_TEACHER_USER || ""; +const TEACHER_PASS = process.env.SELENIUM_TEACHER_PASS || ""; + +describe("Selenium End to End tests.", function () { + this.timeout(30000); + let driver; + + beforeEach(async function () { + driver = await new Builder().forBrowser("chrome").build(); + }); + afterEach(async function () { + await driver.quit(); + }); + + describe("Microsoft integration tests.", function () { + it("Checks if the Student login works properly.", async function () { + // Test name: login student + // Step # | name | target | value + // 1 | open | http://localhost:3000/ | + await driver.get("http://localhost:3000/"); + // 2 | setWindowSize | 1130x789 | + await driver.manage().window().setRect({ width: 1130, height: 789 }); + // 3 | click | css=.css-taj3dd | + await driver.findElement(By.css(".css-taj3dd")).click(); + // 4 | click | id=i0116 | + await driver.findElement(By.id("i0116")).click(); + // 5 | type | id=i0116 + await driver.findElement(By.id("i0116")).sendKeys(STUDENT_USER); + // 6 | type | id=i0118 + await driver.findElement(By.id("i0118")).sendKeys(STUDENT_PASS); + // 7 | click | id=idSIButton9 | + await driver.findElement(By.id("idSIButton9")).click(); + // 8 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 9 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 10 | assert we are on the student page + const attendButton = await driver + .findElement(By.css(".css-16nf58z")) + .getText(); + assert.strictEqual(attendButton, "Attend Class"); + const checkAttendanceButton = await driver + .findElement(By.css(".css-2a592z")) + .getText(); + assert.strictEqual(checkAttendanceButton, "Check Attendance"); + // 11 | click | css=.css-0:nth-child(1) .css-14irisy | + await driver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + }); + + it("Checks if the Teacher login works properly.", async function () { + // Test name: login teacher + // Step # | name | target | value + // 1 | open | http://localhost:3000/ | + await driver.get("http://localhost:3000/"); + // 2 | setWindowSize | 1130x789 | + await driver.manage().window().setRect({ width: 1130, height: 789 }); + // 3 | click | css=.css-taj3dd | + await driver.findElement(By.css(".css-taj3dd")).click(); + // 4 | click | id=i0116 | + await driver.findElement(By.id("i0116")).click(); + // 5 | type | id=i0116 + await driver.findElement(By.id("i0116")).sendKeys(TEACHER_USER); + // 6 | type | id=i0118 + await driver.findElement(By.id("i0118")).sendKeys(TEACHER_PASS); + // 7 | click | id=idSIButton9 | + await driver.findElement(By.id("idSIButton9")).click(); + // 8 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 9 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 10 | assert we are on the teacher page + const addButton = await driver + .findElement(By.css(".css-1a5aj3w")) + .getText(); + assert.strictEqual(addButton, "Add"); + const classHeader = await driver + .findElement(By.css(".css-1zts0j:nth-child(1)")) + .getText(); + assert.strictEqual(classHeader, "CLASS"); + const subjectHeader = await driver + .findElement(By.css(".css-1zts0j:nth-child(2)")) + .getText(); + assert.strictEqual(subjectHeader, "SUBJECT NAME"); + const studentsHeader = await driver + .findElement(By.css(".css-1zts0j:nth-child(3)")) + .getText(); + assert.strictEqual(studentsHeader, "STUDENTS"); + // 11 | click | css=.css-0:nth-child(1) .css-14irisy | + await driver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + }); + }); + + describe("Testing Flow: 'Marking an attendance'.", function () { + it("Checks if the Teacher can start an attendance process and a Student can mark their attendance.", async function () { + // Test name: Mark attendance + // Step # | name | target | value + + // Teacher starting attendance process + + // 1 | open | http://localhost:3000/ | + await driver.get("http://localhost:3000/"); + // 2 | setWindowSize | 1130x789 | + await driver.manage().window().setRect({ width: 1130, height: 789 }); + // 3 | click | css=.css-taj3dd | + await driver.findElement(By.css(".css-taj3dd")).click(); + // 4 | click | id=i0116 | + await driver.findElement(By.id("i0116")).click(); + // 5 | type | id=i0116 + await driver.findElement(By.id("i0116")).sendKeys(TEACHER_USER); + // 6 | type | id=i0118 + await driver.findElement(By.id("i0118")).sendKeys(TEACHER_PASS); + // 7 | click | id=idSIButton9 | + await driver.findElement(By.id("idSIButton9")).click(); + // 8 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 9 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 10 | click | css=.css-5gu8bj:nth-child(1) > .css-xumdn4:nth-child(2) | + await driver + .findElement( + By.css(".css-5gu8bj:nth-child(1) > .css-xumdn4:nth-child(2)") + ) + .click(); + + // Student marking their attendance + + const studentDriver = await new Builder().forBrowser("chrome").build(); + // 11 | open | http://localhost:3000/ | + await studentDriver.get("http://localhost:3000/"); + // 12 | setWindowSize | 1130x789 | + await studentDriver + .manage() + .window() + .setRect({ width: 1130, height: 789 }); + // 13 | click | css=.css-taj3dd | + await studentDriver.findElement(By.css(".css-taj3dd")).click(); + // 14 | click | id=i0116 | + await studentDriver.findElement(By.id("i0116")).click(); + // 15 | type | id=i0116 + await studentDriver.findElement(By.id("i0116")).sendKeys(STUDENT_USER); + // 16 | type | id=i0118 + await studentDriver.findElement(By.id("i0118")).sendKeys(STUDENT_PASS); + // 17 | click | id=idSIButton9 | + await studentDriver.findElement(By.id("idSIButton9")).click(); + // 18 | click | id=idSIButton9 | + await studentDriver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await studentDriver.findElement(By.id("idSIButton9")).click(); + // 19 | click | id=idSIButton9 | + await studentDriver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await studentDriver.findElement(By.id("idSIButton9")).click(); + + const teacherAttendanceCode = driver + .findElement(By.css("span")) + .getText(); + + // 20 | click | id=field-1 | + await studentDriver.findElement(By.id("field-1")).click(); + // 21 | type | id=field-1 | teacherAttendanceCode + await studentDriver + .findElement(By.id("field-1")) + .sendKeys(teacherAttendanceCode); + // 22 | click | css=.css-16nf58z | + await studentDriver.findElement(By.css(".css-16nf58z")).click(); + // 23 | Check that the student attended successfully + await studentDriver.sleep(1000); // Need to wait for the modal to show up + const successMessage = await studentDriver + .findElement(By.css(".css-1x6efgi")) + .getText(); + assert.strictEqual(successMessage, "Success!"); + // 24 | click | css=css-1wyhjrh | + await studentDriver.findElement(By.css(".css-1wyhjrh")).click(); + // 25 | click | css=.css-0:nth-child(1) .css-14irisy | + await studentDriver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + + studentDriver.quit(); + + // Teacher stops attendance process + + // 26 | click | css=.css-1wyhjrh | + await driver.findElement(By.css(".css-1wyhjrh")).click(); + // 27 | click | css=.css-0:nth-child(1) .css-14irisy | + await driver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + }); + + it("Checks if the Teacher can start an attendance process and a Student fails to mark their attendance.", async function () { + // Test name: Mark attendance + // Step # | name | target | value + + // Teacher starting attendance process + + // 1 | open | http://localhost:3000/ | + await driver.get("http://localhost:3000/"); + // 2 | setWindowSize | 1130x789 | + await driver.manage().window().setRect({ width: 1130, height: 789 }); + // 3 | click | css=.css-taj3dd | + await driver.findElement(By.css(".css-taj3dd")).click(); + // 4 | click | id=i0116 | + await driver.findElement(By.id("i0116")).click(); + // 5 | type | id=i0116 + await driver.findElement(By.id("i0116")).sendKeys(TEACHER_USER); + // 6 | type | id=i0118 + await driver.findElement(By.id("i0118")).sendKeys(TEACHER_PASS); + // 7 | click | id=idSIButton9 | + await driver.findElement(By.id("idSIButton9")).click(); + // 8 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 9 | click | id=idSIButton9 | + await driver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await driver.findElement(By.id("idSIButton9")).click(); + // 10 | click | css=.css-5gu8bj:nth-child(1) > .css-xumdn4:nth-child(2) | + await driver + .findElement( + By.css(".css-5gu8bj:nth-child(1) > .css-xumdn4:nth-child(2)") + ) + .click(); + + // Student marking their attendance + + const studentDriver = await new Builder().forBrowser("chrome").build(); + // 11 | open | http://localhost:3000/ | + await studentDriver.get("http://localhost:3000/"); + // 12 | setWindowSize | 1130x789 | + await studentDriver + .manage() + .window() + .setRect({ width: 1130, height: 789 }); + // 13 | click | css=.css-taj3dd | + await studentDriver.findElement(By.css(".css-taj3dd")).click(); + // 14 | click | id=i0116 | + await studentDriver.findElement(By.id("i0116")).click(); + // 15 | type | id=i0116 + await studentDriver.findElement(By.id("i0116")).sendKeys(STUDENT_USER); + // 16 | type | id=i0118 + await studentDriver.findElement(By.id("i0118")).sendKeys(STUDENT_PASS); + // 17 | click | id=idSIButton9 | + await studentDriver.findElement(By.id("idSIButton9")).click(); + // 18 | click | id=idSIButton9 | + await studentDriver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await studentDriver.findElement(By.id("idSIButton9")).click(); + // 19 | click | id=idSIButton9 | + await studentDriver.sleep(2000); // Need to wait for the Microsoft animation to finish for the button to become interactive + await studentDriver.findElement(By.id("idSIButton9")).click(); + // 20 | click | id=field-1 | + await studentDriver.findElement(By.id("field-1")).click(); + // 21 | type | id=field-1 | teacherAttendanceCode + await studentDriver.findElement(By.id("field-1")).sendKeys("ABADCODE"); + // 22 | click | css=.css-16nf58z | + await studentDriver.findElement(By.css(".css-16nf58z")).click(); + // 23 | Check that the student attended successfully + // await studentDriver.sleep(1000); // Need to wait for the modal to show up + const failureMessage = await studentDriver + .findElement(By.id("toast-1-title")) + .getText(); + assert.strictEqual( + failureMessage, + "Seems like you entered the wrong code" + ); + // 24 | click | css=.css-0:nth-child(1) .css-14irisy | + await studentDriver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + + studentDriver.quit(); + + // Teacher stops attendance process + + // 25 | click | css=.css-1wyhjrh | + await driver.findElement(By.css(".css-1wyhjrh")).click(); + // 26 | click | css=.css-0:nth-child(1) .css-14irisy | + await driver + .findElement(By.css(".css-0:nth-child(1) .css-14irisy")) + .click(); + }); + }); +}); diff --git a/docs/testing-deliverables/task-8/stress-performance-testing.pdf b/docs/testing-deliverables/task-8/stress-performance-testing.pdf new file mode 100644 index 0000000..8a529ac Binary files /dev/null and b/docs/testing-deliverables/task-8/stress-performance-testing.pdf differ diff --git a/file-to-make-pull-request.trash b/file-to-make-pull-request.trash new file mode 100644 index 0000000..e69de29