Skip to content
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

fix #5 #6

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Playwright Tests
on:
push:
branches: [ main, dev ]
branches: [ "*" ]
pull_request:
branches: [ main, dev ]
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ addDebugColumnToResultTable = (resultTable) => {
debugIcon.attr('id', `debug-${index}`);
debugIcon.css('cursor', 'pointer');
debugIcon.on("click", () => {
window.location.href = `https://atcoder.jp/contests/${getContestName()}/custom_test?submissionId=${getSubmissionId()}&testcase=${tcfile}&problem=${getProblemName()}`;
window.location.href = `https://atcoder.jp/contests/${getContestName()}/custom_test?submissionId=${getSubmissionId()}&testcase=${tcfile}&problem=${getProblemID()}`;
});
const cell = $('<td class="text-right"></td>');
cell.append(debugIcon);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(async () => {
const testcaseList = await fetchTestCasesList(getContestName(), getProblemName());
const testcaseList = await fetchTestCasesList(getContestName(), getProblemID());
if (testcaseList.length > 0) {
const resultTable = $('.table:last');
addInputColumnToResultTable(resultTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ getContestName = () => {
};

/**
* Retrieve the problem name
* Retrieve the problem ID
* @example A, B, C or D
* @returns {string} The problem name
* @returns {string} The problem ID
*/
getProblemName = () => {
return $(".table") // Selecting the "Submission Info" table
.first()
.find('tr') // The second row contains problem name
.eq(1)
.find('a') // <a> contains url of the problem
.attr('href')
.at(-1) // Last character of url is the problem nam (A, B, C, D)
getProblemID = () => {
return document.querySelector('.table')
.querySelectorAll('tr')[1]
.querySelector('a')
.innerText[0]
.toUpperCase();
};

Expand All @@ -35,4 +32,4 @@ getSubmissionId = () => {
const regex = /contests\/.*\/submissions\/(.*)/gm;
const match = regex.exec(curPath);
return match[1];
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
fetchTestCase = async (testcase, inOrOut = "in") => {
const contest = getContestName();
const problem = getProblemName();
const problem = getProblemID();
const source = `https://raw.githubusercontent.com/conlacda/atcoder-testcases/${contest}/${contest}/${problem}/${inOrOut}/${testcase}`;
const res = await fetchWithRetry(source);
if (res.status !== 200) {
Expand Down
Loading