Skip to content

Commit

Permalink
[TESTING, CYPRESS] 3808 testing fixing import errors in front end tes…
Browse files Browse the repository at this point in the history
…ts (hedyorg#3813)

* Renamed Teacher Page folder to teacher_page

* Renamed file names and removed unused function imports

Co-authored-by: martinj2001 <[email protected]>
  • Loading branch information
CasProgram and martinj2001 authored Dec 9, 2022
1 parent 0d07608 commit b7078a2
Show file tree
Hide file tree
Showing 27 changed files with 34 additions and 41 deletions.
2 changes: 1 addition & 1 deletion templates/for-teachers.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>{{_('my_classes')}}</h2>
<tbody>
{% for class in teacher_classes %}
<tr>
<td class="px-4 py-2"><a href="for-teachers/class/{{class.id}}">{{class.name|e}}</a></td>
<td class="px-4 py-2"><a href="for-teachers/class/{{class.id}}" class="view_class">{{class.name|e}}</a></td>
<td class="text-center p-2">{{class.students|length}}</td>
<td class="text-center p-2"><a class="no-underline cursor-pointer" onclick='hedyApp.duplicate_class("{{class.id}}", {{_('class_name_prompt')|tojson}})')><span class="fas fa-copy"></span></a></td>
<td class="text-center p-2"><a class="no-underline cursor-pointer" onclick='hedyApp.delete_class("{{class.id}}", {{_('delete_class_prompt')|tojson}})'>🗑️</a></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Is able to go to logs page', () => {
loginForTeacher();
cy.wait(500);
createClass();
cy.get("#class_view_button > .no-underline").click(); // Press view class button
cy.get(".view_class").first().click(); // Press view class button

var currentUrl = '';
cy.url().then(url => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Is able to go to class statistics page', () => {
loginForTeacher();
cy.wait(500);
createClass();
cy.get("#class_view_button > .no-underline").click(); // Press view class button
cy.get(".view_class").first().click(); // Press view class button

var currentUrl = '';
cy.url().then(url => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Is able to load data from different timelines', () => {
loginForTeacher();
cy.wait(500);
createClass();
cy.get('#class_view_button').click();
cy.get(".view_class").first().click();
cy.get('#stats_button').click();

// Test button visibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Is able to go back to teacher page', () => {
loginForTeacher();
cy.wait(500);
createClass();
cy.get('#class_view_button').click();
cy.get(".view_class").first().click();

var currentUrl = '';
cy.url().then(url => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Testing individual adventure buttons', () => {
cy.wait(500);
createClass();

cy.get('#class_view_button').click() // Press on view class button
cy.get(".view_class").first().click(); // Press on view class button

cy.get('#customize-class-button').click(); // Press customize class button

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Testing if opening dates is not empty', () => {
cy.wait(500);
createClass();

cy.get('#class_view_button').click() // Press on view class button
cy.get(".view_class").first().click(); // Press on view class button

cy.get('#customize-class-button').click(); // Press customize class button

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Testing if quiz_score has specific value', () => {
cy.wait(500);
createClass();

cy.get('#class_view_button').click() // Press on view class button
cy.get(".view_class").first().click(); // Press on view class button

cy.get('#customize-class-button').click(); // Press customize class button

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Testing all checkboxes', () => {
cy.wait(500);
createClass();

cy.get('#class_view_button').click() // Press on view class button
cy.get(".view_class").first().click(); // Press on view class button

cy.get('#customize-class-button').click(); // Press customize class button

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/signup_page/country_create_account.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/signup_page/email_create_account.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/signup_page/gender_create_account.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
it('passes', () => {
goToPage(Cypress.env('register_student_page'));

goToRegisterStudent();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, goToRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterTeacher} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Subscribe to newsletter test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {goToLogin, gotoRegisterTeacher, goToPage, goToRegisterStudent} from '../tools/navigation/nav.js'
import {goToRegisterStudent} from '../tools/navigation/nav.js'
import {login, loginForUser} from '../tools/login/login.js'

describe('Username field test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get(':nth-child(21) > a').should('have.attr', 'href').and('include', 'https://discord.gg/8yY7dEme9r');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage } from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get('#section-1 > :nth-child(3) > a').should('have.attr', 'href').and('include', 'https://www.youtube.com/watch?v=EdqT313rM40&t=2s');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get('#button-4').should('be.visible');
cy.get('#button-4').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get('#button-4').click();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get('#button-1').should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
loginForTeacher();
cy.wait(500);
goToPage('/for-teachers/manual');
cy.get('#button-2').should('be.visible');
cy.get('#button-2').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {loginForAdmin, loginForTeacher} from '../../tools/login/login.js'
import { goToHome, goToLogin, goToRegister, goToPage } from "../../tools/navigation/nav.js";
import {loginForTeacher} from '../../tools/login/login.js'
import {goToPage} from "../../tools/navigation/nav.js";

describe('Is able to see teacher page', () => {
it('Passes', () => {
Expand Down

0 comments on commit b7078a2

Please sign in to comment.