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: Include additional "Raise an Issue" links #1281

Merged
merged 21 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f0f40a6
Include link to Review Page from Test Run
howard-e Nov 21, 2024
1a93d3e
Fix missing test.id prop error when showing results table on Test Run…
howard-e Nov 21, 2024
977d2af
Update snapshots
howard-e Nov 21, 2024
45e897c
Include "Raise an Issue" link on Test Review page
howard-e Nov 21, 2024
e14933f
Update snapshots
howard-e Nov 21, 2024
196732b
Fix snapshot
howard-e Nov 21, 2024
939c33d
Merge branch 'development' into additional-raise-issue-links
howard-e Dec 5, 2024
b8b9c59
Merge branch 'development' into additional-raise-issue-links
howard-e Dec 10, 2024
321b0fe
Support raising an issue for a specific command from Test Run page
howard-e Dec 16, 2024
ae1ceeb
Merge branch 'development' into additional-raise-issue-links
howard-e Dec 16, 2024
f167097
Update snapshots
howard-e Dec 16, 2024
0d97910
Update test case for checking if results are persisted
howard-e Dec 16, 2024
d418bc6
Infer issue creation's isCandidateReview flag where applicable
howard-e Dec 17, 2024
aeaecc2
Show if issue is being created for a published report
howard-e Dec 17, 2024
292abff
Update snapshots
howard-e Dec 17, 2024
e554df8
Increase bottom margin below command options container, `.raise-issue…
howard-e Dec 19, 2024
e6c8421
Merge branch 'development' into additional-raise-issue-links
howard-e Jan 22, 2025
684ff30
Implement suggested single click 'Raise an Issue for command' link in…
howard-e Jan 22, 2025
654eb76
Better self-documenting variable naming
howard-e Jan 22, 2025
34f10e3
Update snapshots
howard-e Jan 22, 2025
9948169
Update snapshots
howard-e Jan 22, 2025
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
40 changes: 12 additions & 28 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"ignorePatterns": [
"client/dist/*",
"client/dist/bundle.js",
"client/tests/e2e/snapshots/saved"
],
"env": {
"browser": true,
"es6": true,
Expand All @@ -19,40 +24,19 @@
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"react",
"json",
"prettier",
"jest"
],
"plugins": ["react", "json", "prettier", "jest"],
"rules": {
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
],
"eol-last": [
"error",
"always"
],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"eol-last": ["error", "always"],
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
"allow": ["warn", "error"]
}
],
"no-use-before-define": [
"off"
],
"react/display-name": [
"off"
]
"no-use-before-define": ["off"],
"react/display-name": ["off"]
},
"settings": {
"react": {
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
client/dist/*
client/dist/bundle.js

# snaphosts
client/tests/e2e/snapshots/saved
2 changes: 0 additions & 2 deletions client/.eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions client/components/Reports/SummarizeTestPlanReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const SummarizeTestPlanReport = ({ testPlanVersion, testPlanReports }) => {
atVersionName: testResult.atVersion.name,
browserName: testPlanReport.browser.name,
browserVersionName: testResult.browserVersion.name,
versionPhase: testPlanVersion.phase,
reportLink
});

Expand Down
12 changes: 10 additions & 2 deletions client/components/SortableIssuesTable/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const SORT_FIELDS = {
CLOSED_AT: 'closedAt'
};

const SortableIssuesTable = ({ issues }) => {
const SortableIssuesTable = ({ issues, issueLink }) => {
const [activeSort, setActiveSort] = useState(SORT_FIELDS.STATUS);
const [sortOrder, setSortOrder] = useState(TABLE_SORT_ORDERS.ASC);
const [activeFilter, setActiveFilter] = useState('OPEN');
Expand Down Expand Up @@ -187,12 +187,20 @@ const SortableIssuesTable = ({ issues }) => {
{renderTableBody()}
</ThemeTable>
)}
{issueLink && (
<div style={{ marginTop: '1rem' }}>
<a href={issueLink} target="_blank" rel="noreferrer">
Raise an Issue
</a>
</div>
)}
</>
);
};

SortableIssuesTable.propTypes = {
issues: PropTypes.arrayOf(IssuePropType).isRequired
issues: PropTypes.arrayOf(IssuePropType).isRequired,
issueLink: PropTypes.string
};

export default SortableIssuesTable;
19 changes: 16 additions & 3 deletions client/components/TestRenderer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import UnexpectedBehaviorsFieldset from './UnexpectedBehaviorsFieldset';
import supportJson from '../../resources/support.json';
import commandsJson from '../../resources/commands.json';
import { AtPropType, TestResultPropType } from '../common/proptypes/index.js';
import createIssueLink from '@client/utils/createIssueLink';

const Container = styled.div`
width: 100%;
Expand Down Expand Up @@ -163,7 +164,8 @@ const TestRenderer = ({
isReviewingBot = false,
isReadOnly = false,
isEdit = false,
setIsRendererReady = false
setIsRendererReady = false,
commonIssueContent
}) => {
const { scenarioResults, test = {}, completedAt } = testResult;
const { renderableContent } = test;
Expand Down Expand Up @@ -498,7 +500,7 @@ const TestRenderer = ({
{mayAssertionsFailedCount} unsupported)
</SubHeadingText>
<TestPlanResultsTable
test={{ title: header, at }}
test={{ id: test.id, title: header, at }}
testResult={testResult}
/>
</>
Expand Down Expand Up @@ -543,6 +545,13 @@ const TestRenderer = ({
unexpectedBehaviors,
assertionsHeader
} = value;

const commandString = header.replace('After ', '');
const issueLink = createIssueLink({
...commonIssueContent,
commandString
});

return (
<Fragment key={`AtOutputKey_${commandIndex}`}>
<InnerSectionHeadingText>{header}</InnerSectionHeadingText>
Expand All @@ -564,6 +573,9 @@ const TestRenderer = ({
isSubmitted={isSubmitted}
readOnly={isReadOnly}
/>
<a href={issueLink} target="_blank" rel="noreferrer">
Raise an issue for {commandString}
</a>
</Fragment>
);
})}
Expand Down Expand Up @@ -604,7 +616,8 @@ TestRenderer.propTypes = {
isReadOnly: PropTypes.bool,
isEdit: PropTypes.bool,
isReviewingBot: PropTypes.bool,
setIsRendererReady: PropTypes.func
setIsRendererReady: PropTypes.func,
commonIssueContent: PropTypes.object
};

export default TestRenderer;
15 changes: 13 additions & 2 deletions client/components/TestReview/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Fragment, useMemo, useState } from 'react';
import { useQuery } from '@apollo/client';
import { TEST_REVIEW_PAGE_QUERY } from './queries';
import { Container } from 'react-bootstrap';
import { Link, useParams } from 'react-router-dom';
import { Link, useLocation, useParams } from 'react-router-dom';
import { Helmet } from 'react-helmet';
import PageStatus from '../common/PageStatus';
import InstructionsRenderer from '../CandidateReview/CandidateTestPlanRun/InstructionsRenderer';
Expand All @@ -12,6 +12,7 @@ import { derivePhaseName } from '../../utils/aria';
import { dates } from 'shared';
import supportJson from '../../resources/support.json';
import SortableIssuesTable from '../SortableIssuesTable';
import createIssueLink from '../../utils/createIssueLink';

const Ul = styled.ul`
li {
Expand All @@ -28,6 +29,7 @@ const FilterButtonContainer = styled.div`
`;

const TestReview = () => {
const location = useLocation();
const { testPlanVersionId } = useParams();

const { loading, data, error } = useQuery(TEST_REVIEW_PAGE_QUERY, {
Expand Down Expand Up @@ -237,7 +239,16 @@ const TestReview = () => {
}
)}
</ul>
<SortableIssuesTable issues={issues} />
<SortableIssuesTable
issues={issues}
issueLink={createIssueLink({
testPlanTitle: testPlanVersion.title,
testPlanDirectory: testPlanVersion.testPlan.directory,
versionString: testPlanVersion.versionString,
testReviewLink: `https://aria-at-.w3.org${location.pathname}`,
versionPhase: testPlanVersion.versionPhase
})}
/>
<h2>Tests</h2>
<FilterButtonContainer>
<FilterButtons
Expand Down
8 changes: 7 additions & 1 deletion client/components/TestRun/Heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const TestRunHeading = ({
openAsUser,
showEditAtBrowser,
testPlanTitle,
testPlanVersionString,
testPlanVersionReviewLink,
testResults,
testIndex,
testCount,
Expand Down Expand Up @@ -137,6 +139,7 @@ const TestRunHeading = ({
);
}

const testPlanName = `${testPlanTitle} ${testPlanVersionString}`;
return (
<>
<div className="test-info-wrapper">
Expand All @@ -145,7 +148,8 @@ const TestRunHeading = ({
data-testid="apg-example-name"
>
<div className="info-label">
<b>Test Plan:</b> {testPlanTitle}
<b>Test Plan:</b>&nbsp;
<a href={testPlanVersionReviewLink}>{testPlanName}</a>
</div>
</div>
<div className="test-info-entity at-browser" data-testid="at-browser">
Expand Down Expand Up @@ -177,6 +181,8 @@ const TestRunHeading = ({

TestRunHeading.propTypes = {
testPlanTitle: PropTypes.string.isRequired,
testPlanVersionString: PropTypes.string.isRequired,
testPlanVersionReviewLink: PropTypes.string.isRequired,
at: PropTypes.string.isRequired,
browser: PropTypes.string.isRequired,
showEditAtBrowser: PropTypes.bool.isRequired,
Expand Down
18 changes: 9 additions & 9 deletions client/components/TestRun/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { evaluateAuth } from '../../utils/evaluateAuth';
import './TestRun.css';
import ReviewConflicts from '../ReviewConflicts';
import createIssueLink from '../../utils/createIssueLink';
import { dates } from 'shared';
import { Provider as CollectionJobContextProvider } from './CollectionJobContext';
import { useUrlTestIndex } from '../../hooks/useUrlTestIndex';

Expand Down Expand Up @@ -360,16 +359,13 @@ const TestRun = () => {
}
adminReviewerCheckedRef.current = true;

let issueLink;
let issueLink, commonIssueContent;
const hasLoadingCompleted = Object.keys(currentTest).length;
if (hasLoadingCompleted) {
issueLink = createIssueLink({
commonIssueContent = {
testPlanTitle: testPlanVersion.title,
testPlanDirectory: testPlanVersion.testPlan.directory,
versionString: `V${dates.convertDateToString(
testPlanVersion.updatedAt,
'YY.MM.DD'
)}`,
versionString: testPlanVersion.versionString,
testTitle: currentTest.title,
testRowNumber: currentTest.rowNumber,
testSequenceNumber: currentTest.seq,
Expand All @@ -379,7 +375,8 @@ const TestRun = () => {
atVersionName: currentAtVersion?.name,
browserVersionName: currentBrowserVersion?.name,
conflictMarkdown: conflictMarkdownRef.current
});
};
issueLink = createIssueLink(commonIssueContent);
}

const remapScenarioResults = (
Expand Down Expand Up @@ -969,7 +966,7 @@ const TestRun = () => {
<ul className="options-wrapper" aria-labelledby="test-options-heading">
<li>
<OptionButton
text="Raise An Issue"
text="Raise an Issue"
icon={
<FontAwesomeIcon icon={faExclamationCircle} color="#94979b" />
}
Expand Down Expand Up @@ -1051,6 +1048,7 @@ const TestRun = () => {
isSubmitted={isTestSubmitClicked}
isEdit={isTestEditClicked}
setIsRendererReady={setIsRendererReady}
commonIssueContent={commonIssueContent}
/>
</Row>
{isRendererReady && (
Expand Down Expand Up @@ -1143,6 +1141,8 @@ const TestRun = () => {
testPlanTitle={
testPlanVersion.title || testPlanVersion.testPlan?.directory || ''
}
testPlanVersionString={testPlanVersion.versionString}
testPlanVersionReviewLink={`/test-review/${testPlanVersion.id}`}
at={`${testPlanReport.at?.name}${
isViewingRun ? ` ${currentAtVersion?.name}` : ''
}`}
Expand Down
6 changes: 3 additions & 3 deletions client/tests/e2e/TestRun.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,23 @@
await page.waitForSelector('h1 ::-p-text(Test 1)');
await page.waitForSelector('button ::-p-text(Next Test)');

const radioSelector = 'input[type="radio"]';
const radioSelector = 'input[type="radio"][id^="pass-"]';
const test1NavSelector = 'nav#test-navigator-nav ol li:nth-child(1)';
const test2NavSelector = 'nav#test-navigator-nav ol li:nth-child(2)';
const nextTestButtonSelector = 'button ::-p-text(Next Test)';
const previousTestButtonSelector = 'button ::-p-text(Previous Test)';

// Randomly select radio buttons on first test
const generatedCheckedTest1Count =
await getGeneratedCheckedAssertionCount(page, radioSelector);
await getGeneratedCheckedAssertionCount(page);

// Navigate to test 2 with navigation menu
await page.$eval(test2NavSelector, el => el.querySelector('a').click());
await page.waitForNetworkIdle();
await page.waitForSelector('h1 ::-p-text(Test 2:)');
await page.waitForSelector('button ::-p-text(Next Test)');
const generatedCheckedTest2Count =
await getGeneratedCheckedAssertionCount(page, radioSelector);
await getGeneratedCheckedAssertionCount(page);

// Navigate to test 3 with next button
await page.click(nextTestButtonSelector);
Expand Down Expand Up @@ -391,7 +391,7 @@
});
});

it('inputs results and successfully submits', async () => {

Check warning on line 394 in client/tests/e2e/TestRun.e2e.test.js

View workflow job for this annotation

GitHub Actions / Using NodeJS and Postgres 12

Test has no assertions

Check warning on line 394 in client/tests/e2e/TestRun.e2e.test.js

View workflow job for this annotation

GitHub Actions / Using NodeJS and Postgres 12

Test has no assertions
await getPage(
{ role: 'tester', url: '/test-queue' },
async (page, { baseUrl }) => {
Expand All @@ -413,7 +413,7 @@
);
});

it('opens popup with content after clicking "Open Test Page" button', async () => {

Check warning on line 416 in client/tests/e2e/TestRun.e2e.test.js

View workflow job for this annotation

GitHub Actions / Using NodeJS and Postgres 12

Test has no assertions

Check warning on line 416 in client/tests/e2e/TestRun.e2e.test.js

View workflow job for this annotation

GitHub Actions / Using NodeJS and Postgres 12

Test has no assertions
await getPage({ role: 'tester', url: '/test-queue' }, async page => {
await assignSelfAndNavigateToRun(page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ <h2 id="test-options-heading">Test Review Options</h2>
<a
role="button"
tabindex="0"
href="https://github.com/bocoup/aria-at/issues/new?title=JAWS%20Changes%20Requested:%20%22Open%20a%20Modal%20Dialog%20in%20reading%20mode%22%20(Modal%20Dialog%20Example,%20Test%201,%20V22.05.26)&amp;labels=candidate-review,jaws,changes-requested&amp;body=%23%23%20Description%20of%20Behavior%0A%0A%3C!--%20Write%20your%20description%20here%20--%3E%0A%0A%23%23%20Test%20Setup%0A%0A-%20Test%20File%3A%20%5Btest-01-open-a-modal-dialog-reading-jaws.collected.html%5D(https%3A%2F%2Faria-at.netlify.app%2Ftests%2Fmodal-dialog%2Ftest-01-open-a-modal-dialog-reading-jaws.collected.html)%0A-%20AT%3A%20JAWS%0A%0A%3C!--%20The%20following%20data%20allows%20the%20issue%20to%20be%20imported%20into%20the%20ARIA%20AT%20App%20--%3E%0A%3C!--%20ARIA_AT_APP_ISSUE_DATA%20%3D%20%7B%22testPlanDirectory%22%3A%22modal-dialog%22%2C%22versionString%22%3A%22V22.05.26%22%2C%22atName%22%3A%22JAWS%22%2C%22browserName%22%3Anull%2C%22testRowNumber%22%3A1%2C%22testSequenceNumber%22%3A1%2C%22isCandidateReview%22%3Atrue%2C%22isCandidateReviewChangesRequested%22%3Atrue%7D%20--%3E"
href="https://github.com/bocoup/aria-at/issues/new?title=JAWS%20Changes%20Requested:%20%22Open%20a%20Modal%20Dialog%20in%20reading%20mode%22%20(Modal%20Dialog%20Example,%20Test%201,%20V22.05.26)%20for%20Candidate%20Report&amp;labels=candidate-review,jaws,changes-requested&amp;body=%23%23%20Description%20of%20Behavior%0A%0A%3C!--%20Write%20your%20description%20here%20--%3E%0A%0A%23%23%20Test%20Setup%0A%0A-%20Test%20File%3A%20%5Btest-01-open-a-modal-dialog-reading-jaws.collected.html%5D(https%3A%2F%2Faria-at.netlify.app%2Ftests%2Fmodal-dialog%2Ftest-01-open-a-modal-dialog-reading-jaws.collected.html)%0A-%20AT%3A%20JAWS%0A%0A%3C!--%20The%20following%20data%20allows%20the%20issue%20to%20be%20imported%20into%20the%20ARIA%20AT%20App%20--%3E%0A%3C!--%20ARIA_AT_APP_ISSUE_DATA%20%3D%20%7B%22testPlanDirectory%22%3A%22modal-dialog%22%2C%22versionString%22%3A%22V22.05.26%22%2C%22atName%22%3A%22JAWS%22%2C%22browserName%22%3Anull%2C%22testRowNumber%22%3A1%2C%22testSequenceNumber%22%3A1%2C%22isCandidateReview%22%3Atrue%2C%22isCandidateReviewChangesRequested%22%3Atrue%7D%20--%3E"
target="_blank"
aria-disabled="false"
class="btn-options btn btn-secondary"
Expand All @@ -742,7 +742,7 @@ <h2 id="test-options-heading">Test Review Options</h2>
<a
role="button"
tabindex="0"
href="https://github.com/bocoup/aria-at/issues/new?title=JAWS%20Feedback:%20%22Open%20a%20Modal%20Dialog%20in%20reading%20mode%22%20(Modal%20Dialog%20Example,%20Test%201,%20V22.05.26)&amp;labels=candidate-review,jaws,feedback&amp;body=%23%23%20Description%20of%20Behavior%0A%0A%3C!--%20Write%20your%20description%20here%20--%3E%0A%0A%23%23%20Test%20Setup%0A%0A-%20Test%20File%3A%20%5Btest-01-open-a-modal-dialog-reading-jaws.collected.html%5D(https%3A%2F%2Faria-at.netlify.app%2Ftests%2Fmodal-dialog%2Ftest-01-open-a-modal-dialog-reading-jaws.collected.html)%0A-%20AT%3A%20JAWS%0A%0A%3C!--%20The%20following%20data%20allows%20the%20issue%20to%20be%20imported%20into%20the%20ARIA%20AT%20App%20--%3E%0A%3C!--%20ARIA_AT_APP_ISSUE_DATA%20%3D%20%7B%22testPlanDirectory%22%3A%22modal-dialog%22%2C%22versionString%22%3A%22V22.05.26%22%2C%22atName%22%3A%22JAWS%22%2C%22browserName%22%3Anull%2C%22testRowNumber%22%3A1%2C%22testSequenceNumber%22%3A1%2C%22isCandidateReview%22%3Atrue%2C%22isCandidateReviewChangesRequested%22%3Afalse%7D%20--%3E"
href="https://github.com/bocoup/aria-at/issues/new?title=JAWS%20Feedback:%20%22Open%20a%20Modal%20Dialog%20in%20reading%20mode%22%20(Modal%20Dialog%20Example,%20Test%201,%20V22.05.26)%20for%20Candidate%20Report&amp;labels=candidate-review,jaws,feedback&amp;body=%23%23%20Description%20of%20Behavior%0A%0A%3C!--%20Write%20your%20description%20here%20--%3E%0A%0A%23%23%20Test%20Setup%0A%0A-%20Test%20File%3A%20%5Btest-01-open-a-modal-dialog-reading-jaws.collected.html%5D(https%3A%2F%2Faria-at.netlify.app%2Ftests%2Fmodal-dialog%2Ftest-01-open-a-modal-dialog-reading-jaws.collected.html)%0A-%20AT%3A%20JAWS%0A%0A%3C!--%20The%20following%20data%20allows%20the%20issue%20to%20be%20imported%20into%20the%20ARIA%20AT%20App%20--%3E%0A%3C!--%20ARIA_AT_APP_ISSUE_DATA%20%3D%20%7B%22testPlanDirectory%22%3A%22modal-dialog%22%2C%22versionString%22%3A%22V22.05.26%22%2C%22atName%22%3A%22JAWS%22%2C%22browserName%22%3Anull%2C%22testRowNumber%22%3A1%2C%22testSequenceNumber%22%3A1%2C%22isCandidateReview%22%3Atrue%2C%22isCandidateReviewChangesRequested%22%3Afalse%7D%20--%3E"
target="_blank"
aria-disabled="false"
class="btn-options btn btn-secondary"
Expand Down
Loading
Loading