@@ -66,20 +66,52 @@ describe('Nuxt print test', () => {
6666 } )
6767 } )
6868
69- it ( 'downloads PDF' , ( ) => {
70- cy . task ( 'deleteDownloads' )
71- 69+ describe ( 'downloads PDF' , ( ) => {
70+ beforeEach ( ( ) => {
71+ cy . task ( 'deleteDownloads' )
72+ 73+
74+ cy . visit ( '/camps' )
75+ cy . get ( 'a:contains("GRGR")' ) . click ( )
76+ } )
77+
78+ afterEach ( ( ) => {
79+ cy . moveDownloads ( )
80+ } )
81+
82+ it ( 'for whole camp' , ( ) => {
83+ cy . get ( 'a:contains("Admin")' ) . click ( )
84+ cy . get ( 'a:contains("Drucken")' ) . click ( )
85+ cy . get ( 'button:contains("PDF herunterladen (Layout #1)")' ) . click ( )
7286
73- cy . visit ( '/camps' )
74- cy . get ( 'a:contains("GRGR")' ) . click ( )
75- cy . get ( 'a:contains("Admin")' ) . click ( )
76- cy . get ( 'a:contains("Drucken")' ) . click ( )
77- cy . get ( 'button:contains("PDF herunterladen (Layout #1)")' ) . click ( )
87+ const downloadsFolder = Cypress . config ( 'downloadsFolder' )
88+ const pdfPath = path . join ( downloadsFolder , 'Pfila-2023.pdf' )
89+ cy . readFile ( pdfPath , {
90+ timeout : 30000 ,
91+ } )
92+ cy . getPdfProperties ( pdfPath ) . its ( 'numPages' ) . should ( 'eq' , 25 )
93+ } )
94+
95+ it ( 'for picasso' , ( ) => {
96+ if ( Cypress . browser . name === 'firefox' ) {
97+ console . log (
98+ "This test doesn't test browser specific behaviour. Firefox makes problems, thus we dont test this with firefox."
99+ )
100+ return
101+ }
102+
103+ cy . get ( 'a:contains("Programm")' ) . click ( )
104+ cy . get ( '[data-testid="campprogram-menu"]' ) . click ( )
105+ cy . get ( '[role="menuitem"] :contains("PDF herunterladen (Layout #1)")' )
106+ . should ( 'be.visible' )
107+ . click ( )
78108
79- const downloadsFolder = Cypress . config ( 'downloadsFolder' )
80- cy . readFile ( path . join ( downloadsFolder , 'Pfila-2023.pdf' ) , {
81- timeout : 30000 ,
109+ const downloadsFolder = Cypress . config ( 'downloadsFolder' )
110+ const pdfPath = path . join ( downloadsFolder , 'Pfila-2023-Hauptlager.pdf' )
111+ cy . readFile ( pdfPath , {
112+ timeout : 30000 ,
113+ } )
114+ cy . getPdfProperties ( pdfPath ) . its ( 'numPages' ) . should ( 'eq' , 1 )
82115 } )
83- cy . moveDownloads ( )
84116 } )
85117} )
0 commit comments