Skip to content

Commit

Permalink
Merge branch 'master' into 187147065-view-as-graph-multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoldowsky authored Mar 26, 2024
2 parents bf1e3a7 + a8bc36e commit 30c10dd
Show file tree
Hide file tree
Showing 76 changed files with 1,146 additions and 621 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,21 @@ jobs:
with:
flags: cypress-regression
token: ${{ secrets.CODECOV_TOKEN }}
notify-slack:
if: ${{ failure() && github.ref_name == 'master' }}
needs: [regression]
runs-on: ubuntu-latest
steps:
- name: Notify Slack the tests failed
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"ref_name": "${{ github.ref_name }}",
"workflow": "${{ github.workflow }}",
"run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,22 @@ jobs:
# be used. Instead the `|` turns the following lines into a string
topBranches: |
["master"]
notify-slack:
if: ${{ failure() && github.ref_name == 'master' }}
needs: [jest,cypress]
runs-on: ubuntu-latest
steps:
- name: Notify Slack the tests failed
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"ref_name": "${{ github.ref_name }}",
"workflow": "${{ github.workflow }}",
"run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

20 changes: 19 additions & 1 deletion .github/workflows/regression-daily.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Regression Tests
name: Daily Regression

on:
schedule:
Expand Down Expand Up @@ -102,3 +102,21 @@ jobs:
CYPRESS_coverage: true
# Increase memory allocation
NODE_OPTIONS: "--max_old_space_size=4096"
notify-slack:
if: ${{ failure() }}
needs: [all-tests]
runs-on: ubuntu-latest
steps:
- name: Notify Slack the tests failed
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"ref_name": "${{ github.ref_name }}",
"workflow": "${{ github.workflow }}",
"run_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ There are a number of URL parameters that can aid in testing:
The `unit` parameter can be in 3 forms:
- a valid URL starting with `https:` or `http:` will be treated as an absolute URL.
- a string starting with `./` will be treated as a URL relative to the current page in the browser.
- Everything else is treated as a unit code, these codes are first looked up in a map to remap legacy codes. Then the URL of the unit is created by `${curriculumBaseUrl}/branch/${branchName}/${unitCode}/content.json`.
- `curriculumBaseUrl` defaults to `https://models-resources.concord.org/clue-curriculum`.
- Everything else is treated as a unit code, these codes are first looked up in a map to remap legacy codes. Then the URL of the unit is created by `${curriculumSiteUrl}/branch/${branchName}/${unitCode}/content.json`.
- `curriculumSiteUrl` defaults to `https://models-resources.concord.org/clue-curriculum`.
- `branchName` defaults to `main`.
- To find out more about customizing these values look at `app-config-model.ts`.

Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/functional/document_tests/copy_doc_test_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ context('Copy Document', () => {

cy.log("Add number line tile");
clueCanvas.addTile("numberline");
numberlineTile.setToolbarPoint(); //click Point in order to add points to numberline
numberlineTile.addPointOnNumberlineTick(-4.0);
numberlineTile.addPointOnNumberlineTick(2.0);
numberlineTile.getPointsOnGraph().should('have.length', 2);
Expand Down Expand Up @@ -124,7 +125,7 @@ context('Copy Document', () => {
simulatorTile.getSimulatorTile().should("contain.text", "Surface Pressure Sensor");
simulatorTile.getSimulatorTile().should("contain.text", "Temperature Sensor");
simulatorTile.getSimulatorTile().should("contain.text", "Gripper Output");

cy.log("Add Graph tool tile");
clueCanvas.addTile("graph");
xyTile.getTile().should('be.visible');
Expand Down Expand Up @@ -156,7 +157,7 @@ context('Copy Document', () => {

numberlineTile.getNumberlineTile().scrollIntoView().should('be.visible');
numberlineTile.getPointsOnGraph().should('have.length', 2);

imageTile.getImageTile().scrollIntoView().should('be.visible');

datacardTile.getTile().scrollIntoView().should('be.visible');
Expand All @@ -180,4 +181,4 @@ context('Copy Document', () => {
xyTile.getGraphDot().should('have.length.greaterThan', 3);
});
});

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const simulatorTile = new SimulatorTile;
let dashboard = new TeacherDashboard();
let students = [15, 16];

const teacherUrl = `${Cypress.config("qaUnitTeacher6")}&mouseSensor`
const teacherUrl = `${Cypress.config("qaUnitTeacher6")}&mouseSensor`;

function testTilesNotReadOnly(tab, position) {
cy.get('.'+tab).find(position + ' .text-tool').should('not.have.class', 'read-only');
Expand Down Expand Up @@ -96,10 +96,13 @@ function setupTest(studentIndex) {
drawToolTile.getRectangleDrawing().should("exist").and("have.length", 1);
clueCanvas.addTile("expression");
exp.getMathField().should("have.value", "a=\\pi r^2");

clueCanvas.addTile("numberline");
numberlineToolTile.setToolbarPoint(); //click Point in order to add points to numberline
numberlineToolTile.addPointOnNumberlineTick(-4.0);
numberlineToolTile.addPointOnNumberlineTick(2.0);
numberlineToolTile.getPointsOnGraph().should('have.length', 2);

const newName = "Image Tile";
clueCanvas.addTile('image');
cy.get('.primary-workspace .image-tool .editable-tile-title-text').first().should("contain", "Image 1");
Expand Down Expand Up @@ -143,7 +146,7 @@ function setupTestBrain(studentIndex) {

context('Test 4-up and 1-up views tiles read only functionalities', function () {
it('4-up and 1-up views read-only text, table, geometry, drawing, expression, numberline, image, datacard tiles', function () {

cy.clearQAData('all');

setupTest(0);
Expand Down Expand Up @@ -173,7 +176,7 @@ context('Test 4-up and 1-up views tiles read only functionalities', function ()
testTilesReadOnly("student-group-view", ".north-east");
});
it('4-up and 1-up views read-only dataflow, expression, xy plot tiles', function () {

cy.clearQAData('all');

setupTestBrain(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ context('Test copy tiles from one document to other document', function () {

cy.log("Add number line tile");
clueCanvas.addTile("numberline");
numberlineToolTile.setToolbarPoint(); //click Point in order to add points to numberline
numberlineToolTile.addPointOnNumberlineTick(-4.0);
numberlineToolTile.addPointOnNumberlineTick(2.0);
numberlineToolTile.getPointsOnGraph().should('have.length', 2);
Expand Down
108 changes: 90 additions & 18 deletions cypress/e2e/functional/teacher_tests/teacher_sort_work_view_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import SortedWork from "../../../support/elements/common/SortedWork";
import ResourcesPanel from "../../../support/elements/common/ResourcesPanel";
import Canvas from '../../../support/elements/common/Canvas';
import ClueHeader from '../../../support/elements/common/cHeader';
import ChatPanel from "../../../support/elements/common/ChatPanel";

let sortWork = new SortedWork;
let resourcesPanel = new ResourcesPanel;
let dashboard = new TeacherDashboard;
let header = new ClueHeader;
let chatPanel = new ChatPanel;

const canvas = new Canvas;
const title = "1.1 Unit Toolbar Configuration";
const copyTitle = "Personal Workspace";
const title = "1.1 Unit Toolbar Configuration";
const copyTitle = "Personal Workspace";
const queryParams1 = `${Cypress.config("clueTestqaConfigSubtabsUnitTeacher6")}`;
const queryParams2 = `${Cypress.config("qaConfigSubtabsUnitTeacher1")}`;

Expand Down Expand Up @@ -45,35 +48,49 @@ describe('SortWorkView Tests', () => {
sortWork.getSortByMenu().click(); // Open the sort menu
cy.wait(1000);

sortWork.getListItemByName().click(); //Select 'Name' sort type
sortWork.getSortByNameOption().click(); //Select 'Name' sort type
cy.wait(1000);

sortWork.getSortByMenu().click(); // Open the sort menu again
cy.wait(1000);

sortWork.getListItemByGroup().click(); // Select 'Group' sort type
sortWork.getSortByGroupOption().click(); // Select 'Group' sort type
cy.wait(1000);

cy.log('verify opening and closing a document from the sort work view');
sortWork.getSortWorkItem().eq(1).click(); // Open the first document in the list
resourcesPanel.getEditableDocumentContent().should('be.visible');
resourcesPanel.getDocumentCloseButton().click();
sortWork.getSortWorkItem().should('be.visible'); // Verify the document is closed
});


it("should open Sort Work tab and test sorting by group", () => {
const students = ["student:1", "student:2", "student:3", "student:4"]
const studentProblemDocs = [`Student 1: ${title}`, `Student 2: ${title}`, `Student 3: ${title}`,`Student 4: ${title}`];
const studentPersonalDocs = [`Student 1: ${copyTitle}`, `Student 2: ${copyTitle}`, `Student 3: ${copyTitle}`,`Student 4: ${copyTitle}`];
const students = ["student:1", "student:2", "student:3", "student:4"];
const studentProblemDocs = [
`Student 1: ${title}`,
`Student 2: ${title}`,
`Student 3: ${title}`,
`Student 4: ${title}`
];
const studentPersonalDocs = [
`Student 1: ${copyTitle}`,
`Student 2: ${copyTitle}`,
`Student 3: ${copyTitle}`,
`Student 4: ${copyTitle}`
];
const exemplarDocs = [
`Ivan Idea: First Exemplar`
];

cy.log("run CLUE for various students creating their problem and personal documents");
students.forEach(student => {
runClueAsStudent(student);
canvas.copyDocument(copyTitle);
canvas.getPersonalDocTitle().find('span').text().should('contain', copyTitle);
})
});

cy.log("run CLUE as teacher and check student problem and personal documents show in Sort Work");
cy.log("run CLUE as teacher and check student problem, personal, and exemplar docs show in Sort Work");
cy.visit(queryParams2);
cy.waitForLoad();
cy.openTopTab('sort-work');
Expand All @@ -85,29 +102,37 @@ describe('SortWorkView Tests', () => {
sortWork.getSortWorkItem().should('contain', doc);
});

cy.log("verify that exemplar document shows in Sort Work");
sortWork.getSortWorkItem().eq(0).should('contain', exemplarDocs[0]);

cy.log("open problem doc and make sure Edit button doesn't show and Close button shows");
sortWork.getSortWorkItem().contains(studentProblemDocs[0]).click();
resourcesPanel.getDocumentEditButton().should("not.exist");
resourcesPanel.getDocumentCloseButton().should("exist").click();

cy.log("open personal doc and make sure Edit button doesn't show and Close button shows");
sortWork.getSortWorkItem().contains(studentPersonalDocs[0]).click();
resourcesPanel.getDocumentEditButton().should("not.exist");
resourcesPanel.getDocumentCloseButton().should("exist").click();

cy.log("open exemplar doc and make sure Edit button doesn't show and Close button shows");
sortWork.getSortWorkItem().contains(exemplarDocs[0]).click();
resourcesPanel.getDocumentEditButton().should("not.exist");
resourcesPanel.getDocumentCloseButton().should("exist").click();

cy.log("check all problem and personal docs show in the correct group");
studentProblemDocs.forEach(doc => {
sortWork.checkDocumentInGroup("Group 5", doc);
})
});
studentPersonalDocs.forEach(doc => {
sortWork.checkDocumentInGroup("Group 5", doc);
})
});

cy.log("run CLUE as a student:1 and leave the group");
runClueAsStudent(students[0]);
header.leaveGroup();

cy.log("check student:1 problem and personal docs show in No Group");
cy.log("check student:1 problem, exemplar, and personal docs show in No Group");
cy.visit(queryParams2);
cy.waitForLoad();
cy.openTopTab('sort-work');
Expand All @@ -120,7 +145,54 @@ describe('SortWorkView Tests', () => {
sortWork.checkDocumentInGroup("Group 5", studentPersonalDocs[1]);
sortWork.checkDocumentNotInGroup("No Group", studentProblemDocs[1]);
sortWork.checkDocumentNotInGroup("No Group", studentPersonalDocs[1]);

sortWork.checkDocumentInGroup("No Group", exemplarDocs[0]);

cy.log("check that problem and exemplar documents can be sorted by name");
sortWork.getSortByMenu().click();
cy.wait(1000);
sortWork.getSortByNameOption().click();
sortWork.checkSectionHeaderLabelsExist([
"1, Student", "1, Teacher", "2, Student", "3, Student", "4, Student", "Idea, Ivan"
]);
sortWork.checkDocumentInGroup("Idea, Ivan", exemplarDocs[0]);
sortWork.checkDocumentInGroup("1, Student", studentProblemDocs[0]);

cy.log("check that exemplar document is displayed in strategy tag sourced from CMS");
sortWork.getSortByMenu().click();
cy.wait(1000);
sortWork.getSortByTagOption().click();
sortWork.checkDocumentInGroup("Unit Rate", exemplarDocs[0]);

cy.log("check that exemplar document can also be assigned tag by teacher");
sortWork.getSortWorkItem().contains(exemplarDocs[0]).click();
chatPanel.getChatPanelToggle().click();
chatPanel.addCommentTagAndVerify("Diverging Designs");

cy.log("check that exemplar document is displayed in new tag");
chatPanel.getChatCloseButton().click();
cy.openTopTab('sort-work');
// at the moment this is required to refresh the sort
sortWork.getSortByMenu().click();
sortWork.getSortByNameOption().click();
sortWork.getSortByMenu().click();
sortWork.getSortByTagOption().click();
sortWork.checkDocumentInGroup("Diverging Designs", exemplarDocs[0]);

cy.log("remove the teacher added tag and reload");
sortWork.getSortWorkItem().contains(exemplarDocs[0]).click();
chatPanel.getChatPanelToggle().click();
chatPanel.deleteTeacherComments();
cy.wait(1000);
cy.visit(queryParams2);
cy.waitForLoad();
cy.openTopTab('sort-work');

cy.log("check that exemplar document is still displayed in strategy tag sourced from CMS but not in teacher added tag");
sortWork.getSortByMenu().click();
sortWork.getSortByTagOption().click();
sortWork.checkDocumentInGroup("Unit Rate", exemplarDocs[0]);
sortWork.checkGroupIsEmpty("Diverging Designs");

cy.log("run CLUE as a student:1 and join group 6");
runClueAsStudent(students[0], 6);

Expand Down Expand Up @@ -148,5 +220,5 @@ describe('SortWorkView Tests', () => {
sortWork.checkDocumentInGroup("No Group", studentProblemDocs[0]);
sortWork.checkDocumentInGroup("No Group", studentPersonalDocs[0]);
sortWork.checkGroupDoesNotExist("Group 6");
})
})
});
});
20 changes: 14 additions & 6 deletions cypress/e2e/functional/tile_tests/arrow_annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,29 @@ context('Arrow Annotations (Sparrows)', function () {
aa.getAnnotationArrows().should("have.length", 1);
});

it("can add arrows to numberline tiles", () => {
it.only("can add annotations to numberline tiles", () => {
beforeTest(queryParams);
clueCanvas.addTile("numberline");

cy.log("Annotation buttons appear for points");
cy.log("annotations buttons don't exist when empty numberline");
aa.clickArrowToolbarButton();
aa.getAnnotationLayer().should("have.class", "editing");
aa.getAnnotationButtons().should("not.exist");
// Disable the annotation tool again so there isn't a layer on top
// of the numberline tile
aa.clickArrowToolbarButton();
numberlineToolTile.addPointOnNumberlineTick(-4);
numberlineToolTile.addPointOnNumberlineTick(2);

cy.log("add points so we can add annotations");
// Click on tile to get the tool bar to show up
numberlineToolTile.getNumberlineTile().click();
// Switch to point adding mode
numberlineToolTile.setToolbarPoint();
numberlineToolTile.addPointOnNumberlineTick(-4.0);
numberlineToolTile.addPointOnNumberlineTick(2.0);
aa.clickArrowToolbarButton();
aa.getAnnotationButtons().should("have.length", 2);

cy.log("Can add an arrow to numberline points");
aa.getAnnotationButtons().should("exist");
aa.getAnnotationButtons().should("have.length", 2);
aa.getAnnotationArrows().should("not.exist");
aa.getAnnotationButtons().eq(1).click();
aa.getAnnotationButtons().eq(0).click();
Expand Down
Loading

0 comments on commit 30c10dd

Please sign in to comment.