mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-24 17:04:43 +00:00
Migrated from Sprockets to Propshaft.
This commit is contained in:
@@ -71,7 +71,10 @@ describe('Pool to bracket setup', () => {
|
||||
|
||||
|
||||
// Go back to the tournament using the tournament navbar link
|
||||
// Doing intecept/wait because turbo is causing it to act like a spa
|
||||
cy.intercept('GET', /\/tournaments\/\d+$/).as('loadTournamentPageAfterLoop');
|
||||
cy.get('#tournament-navbar .navbar-brand').contains('Tournament Menu').click();
|
||||
cy.wait('@loadTournamentPageAfterLoop');
|
||||
cy.url().should('match', /\/tournaments\/\d+$/); // Check URL is /tournaments/ID
|
||||
cy.contains('Cypress Test Tournament - Pool to bracket').should('be.visible'); // Verify page content
|
||||
|
||||
@@ -93,6 +96,33 @@ describe('Pool to bracket setup', () => {
|
||||
cy.url().should('include', '/generate_matches');
|
||||
});
|
||||
|
||||
it('Should create a new mat.', () => {
|
||||
// Create boys weights
|
||||
// Listen for the confirmation popup and automatically confirm it
|
||||
cy.on('window:confirm', (text) => {
|
||||
return true; // Simulates clicking "OK"
|
||||
});
|
||||
|
||||
// Create Mat 1
|
||||
cy.get('body').then($body => {
|
||||
if (!$body.find('h3:contains("Mats")').length || !$body.find('a:contains("Mat 1")').length) {
|
||||
cy.contains('Director Links').first().click();
|
||||
cy.contains('New Mat').first().click();
|
||||
cy.url().should('include', '/mats/new');
|
||||
cy.get('input[name="mat[name]"]').type('1'); // Mat name is just '1'
|
||||
cy.get('input[type="submit"]').click({ multiple: true });
|
||||
cy.contains('a', 'Mat 1').should('be.visible');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('Should generate matches.', () => {
|
||||
// Generate Matches
|
||||
cy.contains('Director Links').first().click();
|
||||
cy.contains('Generate Brackets').first().click();
|
||||
cy.url().should('include', '/generate_matches');
|
||||
});
|
||||
|
||||
// This was creating a CORS error in Cypress. That seems to be a limitation of Cypress.
|
||||
// Putting this in a separate test to avoid the CORS error.
|
||||
it('Should wait for background jobs to finish.', () => {
|
||||
|
||||
@@ -185,7 +185,7 @@ describe('Matstats Real-time Updates', () => {
|
||||
cy.get('@newLoserScore').clear().type('0');
|
||||
|
||||
// Validation should be working - no error for valid major
|
||||
cy.get('#validation-alerts').should('not.exist').should('not.be.visible');
|
||||
cy.get('#validation-alerts').should('not.be.visible');
|
||||
|
||||
// Try an invalid combination
|
||||
cy.get('#match_win_type').select('Decision');
|
||||
|
||||
Reference in New Issue
Block a user