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

[Testing:TAGrading] demo visual testing mkd #13

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0401069
add devDependency
04vmatsibekker Mar 11, 2024
357c0e7
Fixed dependency
04vmatsibekker Mar 11, 2024
7603f18
Actually run markdown compare
04vmatsibekker Mar 12, 2024
c23ab78
final version
04vmatsibekker Mar 12, 2024
3c78e80
fixes js?
04vmatsibekker Mar 26, 2024
92ffcef
Fix js issue
04vmatsibekker Apr 5, 2024
f57d330
changes
04vmatsibekker Apr 5, 2024
ebf2012
Let github do the work
04vmatsibekker Apr 5, 2024
f01fc51
Have github make image?
04vmatsibekker Apr 5, 2024
964c23e
Update test_forum.spec.js
04vmatsibekker Apr 5, 2024
ad504c8
Update test_forum.spec.js
04vmatsibekker Apr 5, 2024
8ce98e3
image
04vmatsibekker Apr 5, 2024
f9d4d29
Update submitty_ci.yml
04vmatsibekker Apr 12, 2024
10b001d
Merge branch 'main' into image-diff
04vmatsibekker Apr 26, 2024
493e456
Update test_forum.spec.js
04vmatsibekker Apr 26, 2024
1b8f164
Update test_forum.spec.js
04vmatsibekker Apr 26, 2024
94511dd
threashold I trust
04vmatsibekker Apr 26, 2024
dfd7f0d
Update test_forum.spec.js
04vmatsibekker Apr 26, 2024
694cd5e
have it so the original is give at 100% diff allowed
04vmatsibekker Apr 27, 2024
0b84180
Fix merge conflicts
IDzyre Jun 18, 2024
5783a52
Merge branch 'main' into image-diff
IDzyre Jun 18, 2024
88f0ba0
visual testing setup and test
manzil-infinity180 Jul 10, 2024
9ed0159
gitignore
manzil-infinity180 Jul 10, 2024
0885f16
eslint
manzil-infinity180 Jul 10, 2024
3c6ea56
Merge branch 'main' into image-diff
manzil-infinity180 Jul 10, 2024
74e77ac
Updated plugin file
manzil-infinity180 Jul 10, 2024
1c94693
plugins updated
manzil-infinity180 Jul 14, 2024
aec1342
changed viewport , fixed eslint, changed images
manzil-infinity180 Jul 15, 2024
61fc192
commented eslint check for require
manzil-infinity180 Jul 15, 2024
93f387e
different viewport
manzil-infinity180 Jul 16, 2024
75d70af
Merge branch 'main' of https://github.com/Submitty/Submitty into test…
manzil-infinity180 Jul 16, 2024
a9fc3be
changed the path for autograding test
manzil-infinity180 Jul 17, 2024
2b13999
path changed in ci for cy screenshot
manzil-infinity180 Jul 17, 2024
d95b0ca
new image
manzil-infinity180 Jul 17, 2024
62103d1
conflict
manzil-infinity180 Jul 23, 2024
321310a
scroll into view
manzil-infinity180 Jul 23, 2024
5c92ee5
updated images, viewport
manzil-infinity180 Jul 23, 2024
76f7482
divided into three section , changed viewport
manzil-infinity180 Jul 24, 2024
3fbf397
Merge branch 'main' of https://github.com/Submitty/Submitty into test…
manzil-infinity180 Jul 24, 2024
a079c0d
switch the capture position, fixed lint
manzil-infinity180 Jul 24, 2024
4eddee1
deleted markdown_test.spec.js
manzil-infinity180 Jul 24, 2024
66c9db9
renamed artifact name and removed extra line
manzil-infinity180 Jul 25, 2024
944617e
fixed rename of cypress screenshot
manzil-infinity180 Jul 25, 2024
fd96718
added multiple path for cy screenshot
manzil-infinity180 Jul 30, 2024
a8243f6
changed the top image
manzil-infinity180 Jul 31, 2024
57ebff2
centre image fix
manzil-infinity180 Jul 31, 2024
fcdc6d4
Update forums.spec.js
manzil-infinity180 Aug 8, 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
4 changes: 3 additions & 1 deletion .github/workflows/submitty_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ jobs:
if: failure()
with:
name: cypress-screenshots
path: ${{env.SUBMITTY_REPOSITORY}}/site/cypress/screenshots
path: |
${{env.SUBMITTY_REPOSITORY}}/site/cypress/screenshots
${{env.SUBMITTY_REPOSITORY}}/site/cypress-image-diff-screenshots
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ coverage.xml
/site/public/vue/
/site/report/
/site/incremental_build/
/site/cypress-image-diff-screenshots/comparison/
/site/cypress-image-diff-screenshots/diff/
/site/cypress-image-diff-html-report

db_update.php
.setup/data/random_users.txt
Expand Down
2 changes: 1 addition & 1 deletion site/app/templates/autograding/AutoChecks.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
{% endif %}
</div>
<div class="box-block">
<div class="box-block" data-testid="test-box-block">
{% if not check.actual is defined and check.description is defined and check.messages is defined%}
<h4 style="margin-bottom: 0">{{ check.description }}</h4>
<div>
Expand Down
2 changes: 1 addition & 1 deletion site/app/templates/autograding/AutoResults.twig
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
{% endif %}
{% endif %}
>
<span class="loading-tools" id="details_tc_expand_all" style="float:right; margin: 0px 5px 0px 5px;">
<span class="loading-tools" id="details_tc_expand_all" data-testid="details-tc-expand-all" style="float:right; margin: 0px 5px 0px 5px;">
<span class="loading-tools-show" style="color: var(--standard-deep-blue); text-decoration: underline;">
Expand All Test Cases
</span>
Expand Down
2 changes: 1 addition & 1 deletion site/app/templates/forum/ShowForumThreads.twig
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
});
</script>
<div id="posts_list" style="overflow-y: auto; height:100%;" class="col-9">
<div id="posts_list" data-testid="markdown-post-list" style="overflow-y: auto; height:100%;" class="col-9">

{% include "forum/GeneratePostList.twig" with {
"userGroup" : generate_post_content.userGroup,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions site/cypress/e2e/Cypress-Feature/forums.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@
cy.get('[data-testid="thread-list-item"]').contains(title).should('not.exist');
};

describe('Visuals', () => {
Cypress.on('uncaught:exception', (err, runnable) => {
return false
});

Check failure on line 69 in site/cypress/e2e/Cypress-Feature/forums.spec.js

View workflow job for this annotation

GitHub Actions / js-lint

Expected indentation of 8 spaces but found 4

Check failure on line 69 in site/cypress/e2e/Cypress-Feature/forums.spec.js

View workflow job for this annotation

GitHub Actions / js-lint

Missing semicolon
it('should compare screenshot of the entire page', () => {

Check failure on line 70 in site/cypress/e2e/Cypress-Feature/forums.spec.js

View workflow job for this annotation

GitHub Actions / js-lint

Expected indentation of 4 spaces but found 2
cy.viewport(1000, 920);
cy.login('instructor');
cy.visit(['sample', 'forum', 'threads', '9']);
cy.get('[data-testid="markdown-post-list"]').scrollTo('top');
cy.get('[data-testid="markdown-post-list"]').compareSnapshot('forum-threads-top', 0.02, {
capture: 'viewport',
});
cy.get('[data-testid="markdown-post-list"]').scrollTo('center');
cy.get('[data-testid="markdown-post-list"]').compareSnapshot('forum-threads-center', 0.02, {
capture: 'viewport',
});
cy.get('[data-testid="markdown-post-list"]').scrollTo('bottom');
cy.get('[data-testid="markdown-post-list"]').compareSnapshot('forum-threads-bottom', 0.02, {
capture: 'viewport',
});
});
});

const uploadAttachmentAndDelete = (title, attachment) => {
cy.get('[data-testid="thread-list-item"]').contains(title).click();
cy.get('[data-testid="create-post-head"]').should('contain', title);
Expand Down
6 changes: 5 additions & 1 deletion site/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

// eslint-disable-next-line no-undef
const getCompareSnapshotsPlugin = require('cypress-image-diff-js/plugin');

/**
* @type {Cypress.PluginConfig}
*/
export default function (/* on, config */) {
export default function (on, config) {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
return getCompareSnapshotsPlugin(on, config);
}
4 changes: 4 additions & 0 deletions site/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ afterEach(() => {
cy.logout(true, checkLogout);
});
});

// eslint-disable-next-line no-undef
const compareSnapshotCommand = require('cypress-image-diff-js/command');
compareSnapshotCommand();
Loading
Loading