Add initial cypress test for students to join classes
This commit is contained in:
parent
12f3b2d9a7
commit
6688cedd7c
|
|
@ -1,4 +1,4 @@
|
||||||
describe('Survey', () => {
|
describe('Bookmarks', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// todo: mock all the graphql queries and mutations
|
// todo: mock all the graphql queries and mutations
|
||||||
cy.exec("python ../server/manage.py prepare_bookmarks_for_cypress");
|
cy.exec("python ../server/manage.py prepare_bookmarks_for_cypress");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
describe('Survey', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
// todo: mock all the graphql queries and mutations
|
||||||
|
// cy.exec("python ../server/manage.py prepare_bookmarks_for_cypress");
|
||||||
|
|
||||||
|
cy.viewport('macbook-15');
|
||||||
|
cy.apolloLogin('rahel.cueni', 'test');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should join class', () => {
|
||||||
|
cy.visit('/me/profile');
|
||||||
|
|
||||||
|
cy.get('[data-cy=class-selection]').click();
|
||||||
|
cy.get('[data-cy=class-selection-entry]').should('have.length', 1);
|
||||||
|
|
||||||
|
cy.get('[data-cy=join-class-link]').click();
|
||||||
|
|
||||||
|
cy.get('[data-cy=input-class-code]').type('XXXX');
|
||||||
|
cy.get('[data-cy=join-class]').click();
|
||||||
|
|
||||||
|
cy.get('[data-cy=class-selection]').click();
|
||||||
|
cy.get('[data-cy=class-selection-entry]').should('have.length', 2);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="class-selection" v-if="currentClassSelection">
|
<div class="class-selection" v-if="currentClassSelection">
|
||||||
<div class="class-selection__selected-class selected-class" @click="showPopover = !showPopover">
|
<div data-cy="class-selection" class="class-selection__selected-class selected-class"
|
||||||
|
@click="showPopover = !showPopover">
|
||||||
<p class="selected-class__text">Klasse: {{currentClassSelection.name}}</p>
|
<p class="selected-class__text">Klasse: {{currentClassSelection.name}}</p>
|
||||||
</div>
|
</div>
|
||||||
<widget-popover v-if="showPopover"
|
<widget-popover v-if="showPopover"
|
||||||
@hide-me="showPopover = false"
|
@hide-me="showPopover = false"
|
||||||
:mobile="mobile"
|
:mobile="mobile"
|
||||||
class="class-selection__popover">
|
class="class-selection__popover">
|
||||||
<li class="popover-links__link popover-links__link--large" v-for="schoolClass in schoolClasses"
|
<li data-cy="class-selection-entry" class="popover-links__link popover-links__link--large"
|
||||||
|
v-for="schoolClass in schoolClasses"
|
||||||
:key="schoolClass.id"
|
:key="schoolClass.id"
|
||||||
:label="schoolClass.name"
|
:label="schoolClass.name"
|
||||||
:item="schoolClass"
|
:item="schoolClass"
|
||||||
@click="updateFilter(schoolClass)">
|
@click="updateFilter(schoolClass)">
|
||||||
{{schoolClass.name}}
|
{{schoolClass.name}}
|
||||||
</li>
|
</li>
|
||||||
</widget-popover>
|
</widget-popover>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -111,8 +113,8 @@
|
||||||
line-height: $large-spacing;
|
line-height: $large-spacing;
|
||||||
@include regular-text;
|
@include regular-text;
|
||||||
color: $color-silver-dark;
|
color: $color-silver-dark;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.popover-links__link {
|
.popover-links__link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>Join Class</h1>
|
||||||
|
<div>
|
||||||
|
<input data-cy="input-class-code">
|
||||||
|
<a data-cy="join-class">Beitreten</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
@ -10,6 +10,9 @@
|
||||||
<router-link to="/me/profile" active-class="top-navigation__link--active"
|
<router-link to="/me/profile" active-class="top-navigation__link--active"
|
||||||
class="top-navigation__link profile-submenu__item submenu-item">Profil
|
class="top-navigation__link profile-submenu__item submenu-item">Profil
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<router-link to="/me/join-class" active-class="top-navigation__link--active" data-cy="join-class-link"
|
||||||
|
class="top-navigation__link profile-submenu__item submenu-item">Klasse beitreten
|
||||||
|
</router-link>
|
||||||
</nav>
|
</nav>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import moduleRoom from '@/pages/moduleRoom'
|
||||||
import login from '@/pages/login'
|
import login from '@/pages/login'
|
||||||
import registration from '@/pages/registration'
|
import registration from '@/pages/registration'
|
||||||
import waitForClass from '@/pages/waitForClass'
|
import waitForClass from '@/pages/waitForClass'
|
||||||
|
import joinClass from '@/pages/joinClass'
|
||||||
|
|
||||||
import store from '@/store/index';
|
import store from '@/store/index';
|
||||||
|
|
||||||
|
|
@ -109,6 +110,7 @@ const routes = [
|
||||||
{path: 'profile', name: 'profile', component: profile, meta: {isProfile: true}},
|
{path: 'profile', name: 'profile', component: profile, meta: {isProfile: true}},
|
||||||
{path: 'myclasses', name: 'my-classes', component: myClasses, meta: {isProfile: true}},
|
{path: 'myclasses', name: 'my-classes', component: myClasses, meta: {isProfile: true}},
|
||||||
{path: 'activity', name: 'activity', component: activity, meta: {isProfile: true}},
|
{path: 'activity', name: 'activity', component: activity, meta: {isProfile: true}},
|
||||||
|
{path: 'join-class', name: 'join-class', component: joinClass, meta: {isProfile: true}},
|
||||||
{path: '', name: 'profile-activity', component: activity, meta: {isProfile: true}},
|
{path: '', name: 'profile-activity', component: activity, meta: {isProfile: true}},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue