Skip to content

Commit f0e1613

Browse files
committed
[Eslint] cypress lint
1 parent f4bf29c commit f0e1613

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

cypress/e2e/Language_center.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ const hasLanded = () => {
66
}
77

88
const chooseSemester = (semester, fromOrTo) => {
9-
cy.get(`[data-cy="semester-${fromOrTo}"]`)
10-
.click()
11-
.within(() => {
12-
cy.get('div.visible.menu.transition').within(() => {
13-
cy.contains('div.item', semester).click()
14-
})
15-
cy.get('div.menu.transition').should('not.have.class', 'visible')
9+
cy.get(`[data-cy="semester-${fromOrTo}"]`).click()
10+
cy.get(`[data-cy="semester-${fromOrTo}"]`).within(() => {
11+
cy.get('div.visible.menu.transition').within(() => {
12+
cy.contains('div.item', semester).click()
1613
})
14+
cy.get('div.menu.transition').should('not.have.class', 'visible')
15+
})
1716
}
1817

1918
const checkNumbers = (numbers, numberOfColumns, mode) => {

cypress/e2e/Openuni.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,12 @@ describe('Open uni population tests', () => {
3333
cy.get('[data-cy="open-uni-search-button"]').click()
3434
cy.contains('Insert course code(s)').siblings().get('textarea').as('textarea')
3535
cy.get('@textarea').type(courseCodesSet1.join('\n'))
36-
cy.cs('begin-of-search')
37-
.click()
38-
.then(() => {
39-
cy.cs('begin-of-search').clear()
40-
cy.cs('begin-of-search').type('01.01.2015')
41-
})
42-
cy.cs('end-of-search')
43-
.click()
44-
.then(() => {
45-
cy.cs('end-of-search').clear()
46-
cy.cs('end-of-search').type('01.01.2020')
47-
})
36+
cy.cs('begin-of-search').click()
37+
cy.cs('begin-of-search').clear()
38+
cy.cs('begin-of-search').type('01.01.2015')
39+
cy.cs('end-of-search').click()
40+
cy.cs('end-of-search').clear()
41+
cy.cs('end-of-search').type('01.01.2020')
4842
cy.get('button').contains('Search population').click()
4943
cy.contains('Beginning of the search for all fields:')
5044
cy.contains('01.01.2015')
@@ -86,9 +80,10 @@ describe('Open uni population tests', () => {
8680
cy.get('[data-cy="search-name"]').type('TEST-Avoimen-populaatio')
8781
cy.contains('Insert course code(s)').siblings().get('textarea').type(courseCodesSet1.join('\n'))
8882
cy.get('[data-cy="save-search"]').click()
89-
cy.get('[data-cy="history-search"]').children().eq(0).type('TEST-Avoimen-populaatio').type('{enter}')
83+
cy.get('[data-cy="history-search"]').children().eq(0).type('TEST-Avoimen-populaatio{enter}')
9084
cy.contains('TEST-Avoimen-populaatio')
91-
cy.get('button').contains('Search population').click()
85+
cy.get('button').contains('Search population').as('btn')
86+
cy.get('@btn').click()
9287
cy.get('[data-cy="open-uni-table-div"]').should('contain.text', courseCodesSet1[0])
9388
cy.get('[data-cy="open-uni-table-div"]').should('contain.text', courseCodesSet1[1])
9489
})
@@ -105,7 +100,7 @@ describe('Open uni population tests', () => {
105100
cy.get('[data-cy="open-uni-table-div"]').should('contain.text', courseCodesSet1[1])
106101

107102
cy.get('[data-cy="open-uni-search-button"]').click()
108-
cy.get('[data-cy="history-search"]').children().eq(0).type('TEST-Avoimen-populaatio').type('{enter}')
103+
cy.get('[data-cy="history-search"]').children().eq(0).type('TEST-Avoimen-populaatio{enter}')
109104
cy.contains('Insert course code(s)').siblings().get('textarea').should('contain', courseCodesSet1.join(', '))
110105
cy.contains('Insert course code(s)').siblings().get('textarea').type('\n')
111106
cy.contains('Insert course code(s)').siblings().get('textarea').type(courseCodesSet2.join('\n'))

cypress/e2e/Population_statistics.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ describe('Population statistics tests', () => {
5050
cy.cs('population-year-decrement').as('yearDecrement')
5151
cy.cs('population-year-increment').as('yearIncrement')
5252

53-
cy.get('@yearSelect')
54-
.click()
55-
.then(() => cy.contains('2018 - 2019').trigger('click', { force: true }))
53+
cy.get('@yearSelect').click()
54+
cy.contains('2018 - 2019').click()
5655
cy.get('@yearSelect').within(() => cy.contains('2018 - 2019'))
5756
cy.get('@yearDecrement').click()
5857
cy.get('@yearSelect').within(() => cy.contains('2017 - 2018'))
@@ -277,13 +276,20 @@ describe('Population statistics tests', () => {
277276
cy.visit(pathToMathBSc2020)
278277
cy.contains('Courses of class').click()
279278

280-
cy.cs('curriculum-picker').scrollIntoView().should('be.visible').click()
279+
cy.cs('curriculum-picker').scrollIntoView()
280+
cy.cs('curriculum-picker').should('be.visible')
281+
cy.cs('curriculum-picker').click()
281282
cy.contains('2020–2023').click({ force: true })
282283
cy.contains('Students (27)')
283-
cy.cs('toggle-group-module-DIGI-k').should('exist').scrollIntoView().should('be.visible').click({ force: true })
284+
cy.cs('toggle-group-module-DIGI-k').should('exist')
285+
cy.cs('toggle-group-module-DIGI-k').scrollIntoView()
286+
cy.cs('toggle-group-module-DIGI-k').should('be.visible')
287+
cy.cs('toggle-group-module-DIGI-k').click({ force: true })
284288
cy.contains('DIGI-100').should('exist')
285289

286-
cy.cs('curriculum-picker').scrollIntoView().should('be.visible').click()
290+
cy.cs('curriculum-picker').scrollIntoView()
291+
cy.cs('toggle-group-module-DIGI-k').should('be.visible')
292+
cy.cs('curriculum-picker').click()
287293
cy.contains('2023–2026').click({ force: true })
288294
cy.cs('toggle-group-module-DIGI-k').should('exist')
289295
cy.contains('DIGI-100').should('not.exist')

cypress/plugins/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
/**
1616
* @type {Cypress.PluginConfig}
1717
*/
18-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1918
module.exports = (on, config) => {
2019
// `on` is used to hook into various events Cypress emits
2120
// `config` is the resolved Cypress config

0 commit comments

Comments
 (0)