-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,284 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Lab4 | ||
|
||
## Introduction | ||
|
||
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. | ||
|
||
## Preparation (Important!!!) | ||
|
||
1. Sync fork your branch (e.g., `SQLab:311XXXXXX`) | ||
2. `git checkout -b lab4` (**NOT** your student ID !!!) | ||
|
||
## Requirement | ||
|
||
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. | ||
|
||
For the detailed steps and hints, please check the slide of this lab. | ||
|
||
You can run `validate.sh` in your local to test if you satisfy the requirements. | ||
|
||
Please note that you must not alter files other than `main_test.js`. You will get 0 points if | ||
|
||
1. you modify other files to achieve requirements. | ||
2. you can't pass all CI on your PR. | ||
|
||
## Submission | ||
|
||
You need to open a pull request to your branch (e.g. 311XXXXXX, your student number) and contain the code that satisfies the abovementioned requirements. | ||
|
||
Moreover, please submit the URL of your PR to E3. Your submission will only be accepted when you present at both places. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const puppeteer = require('puppeteer'); | ||
|
||
(async () => { | ||
// Launch the browser and open a new blank page | ||
const browser = await puppeteer.launch(); | ||
const page = await browser.newPage(); | ||
|
||
// Navigate the page to a URL | ||
await page.goto('https://pptr.dev/'); | ||
|
||
// Hints: | ||
// Click search button | ||
// Type into search box | ||
// Wait for search result | ||
// Get the `Docs` result section | ||
// Click on first result in `Docs` section | ||
// Locate the title | ||
// Print the title | ||
|
||
// Close the browser | ||
await browser.close(); | ||
})(); |
Oops, something went wrong.