mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Fix tests that were broken after adding user rights to frontend
This commit is contained in:
@@ -10,6 +10,7 @@ module.exports = defineConfig({
|
||||
pageLoadTimeout: 140000,
|
||||
requestTimeout: 80000,
|
||||
responseTimeout: 80000,
|
||||
testIsolation: false,
|
||||
},
|
||||
viewportHeight: 900,
|
||||
viewportWidth: 1200,
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
const baseUrl = 'http://localhost:5173/'
|
||||
|
||||
describe('Open each page, table view and detail view, and check at least some correct text appears', () => {
|
||||
before('Login as admin, directs to front page', () => {
|
||||
cy.session("logged-as-admin", () => {})
|
||||
cy.visit(baseUrl)
|
||||
cy.contains('construction')
|
||||
cy.contains('Login').click()
|
||||
cy.get('[data-cy="username-basic"]').type("testSu")
|
||||
cy.get('[data-cy="password-basic"]').type("test")
|
||||
cy.get('[data-cy="login-button"]').click()
|
||||
cy.contains('construction')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit(baseUrl)
|
||||
})
|
||||
it('Front page works', () => {
|
||||
cy.contains('construction')
|
||||
})
|
||||
it('Locality works', () => {
|
||||
cy.contains('Locality').click()
|
||||
cy.contains('Dmanisi')
|
||||
cy.get('[data-cy="detailview-button-21050"]').click()
|
||||
cy.contains('Dating method')
|
||||
cy.contains('olduvai')
|
||||
|
||||
})
|
||||
it('Species works', () => {
|
||||
cy.contains('Species').click()
|
||||
@@ -20,6 +28,7 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
cy.get('[data-cy="detailview-button-21052"]').first().click()
|
||||
cy.contains('Class')
|
||||
cy.contains('Simplomys')
|
||||
|
||||
})
|
||||
it('Reference works', () => {
|
||||
cy.contains('Reference').click()
|
||||
@@ -27,6 +36,7 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
cy.get('[data-cy="detailview-button-10039"]').first().click()
|
||||
cy.contains('Reference type')
|
||||
cy.contains('A new geomagnetic polarity time scale for the Late Cretaceous and Cenozoic')
|
||||
|
||||
})
|
||||
it('Time Unit works', () => {
|
||||
cy.contains('Time Unit').click()
|
||||
@@ -34,6 +44,7 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
cy.get('[data-cy="detailview-button-langhian"]').first().click()
|
||||
cy.contains('Sequence')
|
||||
cy.contains('gcss')
|
||||
|
||||
})
|
||||
it('Region works', () => {
|
||||
cy.contains('Admin').click()
|
||||
@@ -43,7 +54,7 @@ describe('Open each page, table view and detail view, and check at least some co
|
||||
cy.contains('Regional Coordinators')
|
||||
cy.contains('prs')
|
||||
})
|
||||
it.only('Project works', () => {
|
||||
it('Project works', () => {
|
||||
cy.get('div[id="/admin-menu-button"]').click()
|
||||
cy.get('a[id="/project-menu-link"]').click()
|
||||
cy.contains('Workgroup on Insectivores')
|
||||
|
||||
@@ -44,7 +44,7 @@ export const Login = () => {
|
||||
<Container style={{ alignContent: 'center' }} maxWidth="sm">
|
||||
<Stack rowGap="1em">
|
||||
<TextField
|
||||
id="username-basic"
|
||||
data-cy="username-basic"
|
||||
label="Username"
|
||||
variant="outlined"
|
||||
type="text"
|
||||
@@ -55,7 +55,7 @@ export const Login = () => {
|
||||
fullWidth
|
||||
/>
|
||||
<TextField
|
||||
id="password-basic"
|
||||
data-cy="password-basic"
|
||||
label="Password"
|
||||
variant="outlined"
|
||||
type="password"
|
||||
@@ -65,7 +65,7 @@ export const Login = () => {
|
||||
helperText={passwordError}
|
||||
fullWidth
|
||||
/>
|
||||
<Button onClick={() => void login()} size="large" style={{ fontSize: '1.4em' }}>
|
||||
<Button data-cy="login-button" onClick={() => void login()} size="large" style={{ fontSize: '1.4em' }}>
|
||||
Login
|
||||
</Button>
|
||||
<Box>
|
||||
|
||||
Reference in New Issue
Block a user