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

AT fixes and Addition of EDX-1251 #995

Merged
merged 2 commits into from
Aug 25, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@

<v-row justify="space-between">
<v-col cols="4">
<span class="bold">Students Found: {{ totalElements }} </span>
<span
id="studentsFound"
class="bold"
>Students Found: {{ totalElements }} </span>
<v-icon
small
class="ml-1"
Expand Down Expand Up @@ -149,7 +152,7 @@
},
mixins: [alertMixin],
props: {
config: {

Check warning on line 155 in frontend/src/components/sdcCollection/stepThreeVerifyData/DetailComponent.vue

View workflow job for this annotation

GitHub Actions / test

Prop "config" should define at least its type
tabFilter: Object,
required: true,
default: null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import selectors from "../../support/selectors";
import { AppSetupData } from '../../../cypress.config';
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service";

describe('SDC School Collection View', () => {
context('As an EDX School User', () => {
before(() => {
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true,
seedData: 'stepThreeSeedData'
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] });
});
});
after(() => cy.logout());
beforeEach(() => cy.login());

it('can load dashboard & click data collection card & process collection', () => {
cy.visit('/');
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School');
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();

// Step five of collection - school contacts
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Testing School');
cy.get(selectors.schoolContacts.newContactButton).click();
cy.get(selectors.schoolContacts.newContactTypeDropdown).parent().click();
cy.get(selectors.schoolContacts.listItem).contains('Principal').click();
cy.get(selectors.schoolContacts.newContactLastNameInput).type('Fake Principal');
cy.get(selectors.schoolContacts.newContactEmailInput).type('fake@gmail.com');
cy.get(selectors.schoolContacts.newContactPhoneNumberInput).type('1231231234');
cy.get(selectors.schoolContacts.newContactEffectiveDateTextField).click();
cy.get(selectors.schoolContacts.newContactCalendar).contains('Select').click();
cy.get(selectors.schoolContacts.newContactPostBtn).click();
cy.get(selectors.snackbar.mainSnackBar).should('contain', 'Success! The school contact has been created.');
});

});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import selectors from "../../support/selectors";
import { AppSetupData } from '../../../cypress.config';
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service";

describe('SDC School Collection View', () => {
context('As an EDX School User', () => {
before(() => {
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true,
seedData: 'stepThreeSeedData'
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] });
});
});
after(() => cy.logout());
beforeEach(() => cy.login());

it('can load dashboard & click data collection card & process collection', () => {
cy.visit('/');
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School');
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.studentLevelData.nextButton).click();

// Step four of collection - school details
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.schoolDetails.schoolMincodeTitle).contains('99899998');
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Testing School');
cy.get(selectors.schoolDetails.editButton).click();
cy.get(selectors.schoolDetails.schoolDetailsEmail).clear();
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).clear();
cy.get(selectors.studentLevelData.formHint).contains('Address, phone, and/or email must be added');
cy.get(selectors.studentLevelData.nextButton).should('be.disabled');
cy.get(selectors.schoolDetails.schoolDetailsEmail).type('fake@gmail.com');
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).type('1234567890');
cy.get(selectors.schoolDetails.saveButton).click();
cy.get(selectors.schoolDetails.resolveBtn).click();
});

});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import selectors from "../../support/selectors";
import { AppSetupData } from '../../../cypress.config';
import { SchoolCollection } from "tests-e2e/cypress/services/sdc-collection-api-service";

describe('SDC School Collection View', () => {
context('As an EDX School User', () => {
before(() => {
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true,
seedData: 'stepThreeSeedData'
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] });
});
});
after(() => cy.logout());
beforeEach(() => cy.login());

it('can load dashboard & click data collection card & process collection', () => {
cy.intercept(Cypress.env('interceptors').collection_students_pagination).as('pagination');

cy.visit('/');
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School');
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

// Step three of collection - edit/verify data
cy.get(selectors.studentLevelData.nextButton).click();
});

it('verifies FTE for Reported Students', () => {
cy.intercept(Cypress.env('interceptors').collection_students_pagination).as('pagination');
cy.visit('/');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

// Step three of collection - edit/verify data
cy.get(selectors.studentLevelData.nextButton).click();
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(2);

cy.get('.td-data').each(cell => {
const cellText = cell.text()
if (cellText === '1' || cellText === '0.875') {
cy.log('Correct fte value expected')
}
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe('SDC School Collection View', () => {
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true
loadWithStudentAndValidations: true,
seedData: 'stepTwoSeedData'
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] });
});
Expand Down
70 changes: 9 additions & 61 deletions tests-e2e/cypress/e2e/sdc-collection/sdcSchoolCollectionView.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,40 @@ describe('SDC School Collection View', () => {
context('As an EDX School User', () => {
before(() => {
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections',{
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: false} );
loadWithStudentAndValidations: true,
seedData: 'stepThreeSeedData'
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', { schoolCodes: ['99998'] });
});
});
after(() => cy.logout());
beforeEach(() => cy.login());

it('can load dashboard & click data collection card & process collection', () => {
it('can return to previous step in collection', () => {
cy.visit('/');
cy.get(selectors.dashboard.title).contains('Dashboard | EDX Automation Testing School');
cy.get(selectors.dashboard.dataCollectionsTileTitle).contains('Data Collections');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

//step one of collection
cy.get(selectors.studentLevelData.documentUploadButton).click();
cy.get(selectors.documentUpload.selectFileInput).selectFile('./cypress/uploads/sample-2-student-fnchars.std', {force: true});
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');

// Timeout exception made since time to upload is variable depending on the file size and format.
cy.get(selectors.snackbar.mainSnackBar, {timeout: 10000}).contains('Your document was uploaded successfully.');
cy.get(selectors.studentLevelData.nextButton, {timeout: 15000}).should('exist').click();

// step two of collection - review and fix data
cy.get(selectors.studentLevelData.nextButton).click();

//step three of collection - edit/verify data
cy.get(selectors.studentLevelData.nextButton).click();

// step four of collection
cy.get(selectors.schoolDetails.schoolMincodeTitle).contains('99899998');
cy.get(selectors.schoolDetails.schoolDisplayNameTitle).contains('EDX Automation Testing School');
cy.get(selectors.schoolDetails.editButton).click();
cy.get(selectors.schoolDetails.schoolDetailsEmail).clear();
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).clear();
cy.get(selectors.studentLevelData.formHint).contains('Address, phone, and/or email must be added');
cy.get(selectors.studentLevelData.nextButton).should('be.disabled');
cy.get(selectors.schoolDetails.schoolDetailsEmail).type('fake@gmail.com');
cy.get(selectors.schoolDetails.schoolDetailsPhoneNumber).type('1234567890');
cy.get(selectors.schoolDetails.saveButton).click();
cy.get(selectors.schoolDetails.resolveBtn).click();
cy.get(selectors.studentLevelData.nextButton).click();

//step five of collection
cy.get(selectors.schoolContacts.subjectHeading).contains('99899998 - EDX Automation Testing School');
cy.get(selectors.schoolContacts.newContactButton).click();
cy.get(selectors.schoolContacts.newContactTypeDropdown).parent().click();
cy.get(selectors.schoolContacts.listItem).contains('Principal').click();
cy.get(selectors.schoolContacts.newContactLastNameInput).type('Fake Principal');
cy.get(selectors.schoolContacts.newContactEmailInput).type('fake@gmail.com');
cy.get(selectors.schoolContacts.newContactPhoneNumberInput).type('1231231234');
cy.get(selectors.schoolContacts.newContactEffectiveDateTextField).click();
cy.get(selectors.schoolContacts.newContactCalendar).contains('Select').click();
cy.get(selectors.schoolContacts.newContactPostBtn).click();
cy.get(selectors.studentLevelData.nextButton).click();

});

it('can return to previous step in collection', () => {
cy.visit('/');
cy.get(selectors.dashboard.dataCollectionsTile).click();
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

//step one of collection - upload file
cy.get(selectors.studentLevelData.documentUploadButton).click();
cy.get(selectors.documentUpload.selectFileInput).selectFile('./cypress/uploads/sample-2-student-fnchars.std', {force: true});
cy.get(selectors.dataCollectionsLanding.title).should('exist').contains('Student Level Data (1701) | EDX Automation Testing School');
cy.get(selectors.studentLevelData.nextButton, {timeout: 15000}).should('exist').should('be.enabled').click();

// step two of collection - review and fix data
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click();

//step three of collection - edit/verify data
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click();

// checking if the previous button is clickable and the user is taken to the previous step; brings to step 2
cy.get(selectors.studentLevelData.stepTwo).should('exist').should('be.enabled').click();
cy.get(selectors.studentLevelData.stepTwo).should('exist').click();

// Step three should be disabled
cy.get(selectors.studentLevelData.stepThree).should('exist').should('be.disabled');
cy.get(selectors.studentLevelData.stepThree).should('exist').should('not.be.enabled');

// User moved to next step by clicking next button
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled').click();
cy.get(selectors.studentLevelData.nextButton).should('exist').should('be.enabled');
cy.get(selectors.studentLevelData.nextButton).click();

});
});
Expand Down
Loading