Skip to content

Commit 906208f

Browse files
authored
Merge branch 'SQLab:main' into main
2 parents ee9a517 + c6406a3 commit 906208f

File tree

19 files changed

+1559
-1
lines changed

19 files changed

+1559
-1
lines changed

.github/workflows/lab-autograding.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ jobs:
4545
const files = await github.rest.pulls.listFiles({ owner, repo, pull_number: issue_number });
4646
const changedFiles = files.data.map((file) => file.filename);
4747
const allowedFileRegex = /^lab\d+\/main_test.js$/;
48-
const specialChangedFiles = ["lab0/lab0.js"];
48+
const specialChangedFiles = ["lab0/lab0.js", "lab5/antiasan.c", "lab6/llvm-pass.so.cc"];
4949
if (!changedFiles.every((file) => (allowedFileRegex.test(file) || specialChangedFiles.includes(file)))) {
5050
core.setFailed('The PR contains changes to files other than the allowed files.');
5151
}
5252
return labNumber;
5353
- name: Grading
5454
run: |
5555
cd lab${{ steps.lab.outputs.result }}
56+
if [ ${{ steps.lab.outputs.result }} -eq 6 ]; then
57+
sudo apt install -y llvm-14
58+
fi
5659
./validate.sh

lab4/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Lab4
2+
3+
## Introduction
4+
5+
In this lab, you will write tests in `main_test.js`. You can learn how to use [Puppeteer](https://pptr.dev/) to tests a web UI.
6+
7+
## Preparation (Important!!!)
8+
9+
1. Sync fork your branch (e.g., `SQLab:312XXXXXX`)
10+
2. `git checkout -b lab4` (**NOT** your student ID !!!)
11+
12+
## Requirement
13+
14+
1. (100%) Goto https://pptr.dev/, type `chipi chipi chapa chapa` into the search box, click on **1st** result in the **Docs** section, and print the title.
15+
16+
For the detailed steps and hints, please check the slide of this lab.
17+
18+
You can run `validate.sh` in your local to test if you satisfy the requirements.
19+
20+
Please note that you must not alter files other than `main_test.js`. You will get 0 points if
21+
22+
1. you modify other files to achieve requirements.
23+
2. you can't pass all CI on your PR.
24+
25+
## Submission
26+
27+
You need to open a pull request to your branch (e.g. 312XXXXXX, your student number) and contain the code that satisfies the abovementioned requirements.
28+
29+
Moreover, please submit the URL of your PR to E3. Your submission will only be accepted when you present at both places.

lab4/main_test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const puppeteer = require('puppeteer');
2+
3+
(async () => {
4+
// Launch the browser and open a new blank page
5+
const browser = await puppeteer.launch();
6+
const page = await browser.newPage();
7+
8+
// Navigate the page to a URL
9+
await page.goto('https://pptr.dev/');
10+
11+
// Hints:
12+
// Click search button
13+
// Type into search box
14+
// Wait for search result
15+
// Get the `Docs` result section
16+
// Click on first result in `Docs` section
17+
// Locate the title
18+
// Print the title
19+
20+
// Close the browser
21+
await browser.close();
22+
})();

0 commit comments

Comments
 (0)