Skip to content

[LAB4] 510558017 #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2233c14
fix: improve workflows
AlaRduTP Mar 13, 2024
e2b8057
fix: scripts/rebase-all.sh will fail due to too frequent remote opera…
AlaRduTP Mar 13, 2024
8336df3
feat: lab2
AlaRduTP Mar 13, 2024
0f5c5dd
feat: merge-all
AlaRduTP Mar 13, 2024
5fa8ffe
remove: create-branches.sh
AlaRduTP Mar 20, 2024
354fae7
feat: auto resolve conflicts when merging
AlaRduTP Mar 20, 2024
e49fa08
feat: improve GitHub workflows
AlaRduTP Mar 20, 2024
c895269
feat: lab3
AlaRduTP Mar 20, 2024
22a9521
feat: an easy check for changed files
AlaRduTP Mar 20, 2024
15ca1a7
doc: detailed steps of syncing fork
AlaRduTP Mar 20, 2024
dd650d8
fix: remove trailing whitespace
AlaRduTP Mar 20, 2024
cee6631
feat: add node_modules into gitignore
AlaRduTP Mar 27, 2024
ffbfbd7
feat: lab4
AlaRduTP Mar 27, 2024
5ee9d55
Add lab5
YingMuo Apr 17, 2024
86b3714
Fix github action
YingMuo Apr 17, 2024
c27f68f
Fix README.md
YingMuo Apr 17, 2024
419ed6d
fix: gh-script syntax error
AlaRduTP Apr 17, 2024
41cc403
add: lab6
YingMuo Apr 24, 2024
9777d36
feat: lab6
YingMuo Apr 24, 2024
110400a
fix: lab6
YingMuo Apr 24, 2024
eae2c35
fix: lab6
YingMuo Apr 24, 2024
2063787
Fix: lab6
YingMuo Apr 24, 2024
a2f55d5
Add: lab7
YingMuo May 1, 2024
56585b1
Fix: lab7
YingMuo May 1, 2024
7a945c9
Fix: lab7, angr not installed
YingMuo May 1, 2024
bb5fb3d
feat: add hw4
TaiYou-TW May 30, 2024
b88ef9e
fix: wrong days for hw4 leap year
TaiYou-TW May 30, 2024
e5e3c94
Update main_test.js
as10968574 Jun 11, 2024
aa71a67
Merge branch '510558017' into lab4
as10968574 Jun 11, 2024
f5f965b
Delete hw4/.gitignore
as10968574 Jun 24, 2024
53f26e7
Delete hw4/README.md
as10968574 Jun 24, 2024
970ca68
Delete hw4/package.json
as10968574 Jun 24, 2024
9709f93
Delete hw4/tests/calculator_test.js
as10968574 Jun 24, 2024
359259f
Delete hw4/stryker.config.json
as10968574 Jun 24, 2024
c25332b
Delete hw4/src/calculator.js
as10968574 Jun 24, 2024
ada9487
Delete hw4/package-lock.json
as10968574 Jun 24, 2024
71761a7
Update main_test.js
as10968574 Jun 24, 2024
e6d2ca1
Update main_test.js
as10968574 Jun 24, 2024
11ffa5d
Update main_test.js
as10968574 Jun 24, 2024
7b741df
Update main_test.js
as10968574 Jun 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions lab4/main_test.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
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
await page.click('button.DocSearch.DocSearch-Button');

// Type into search box
// Wait for search result
// Get the `Docs` result section
// Click on first result in `Docs` section
await page.waitForSelector('#docsearch-input');
await page.type('#docsearch-input', 'Experimental WebDriver BiDi support', { delay: 150 });

// Wait for search result and click on the first result
await page.waitForSelector('.DocSearch-Hits', { timeout: 60000 });
const hits = await page.$$('.DocSearch-Hit');
if (hits.length > 0) {
await hits[0].click();
} else {
throw new Error('No search results found');
}

// Locate the title
let textSelector = await page.waitForSelector('h1', { timeout: 60000 });
let title = await textSelector.evaluate(element => element.textContent);

// Print the title
console.log(title);

// Close the browser
await browser.close();
})();
})();
Loading