Skip to content

Commit

Permalink
More predictive way of creating a field
Browse files Browse the repository at this point in the history
  • Loading branch information
mika-robots committed Oct 9, 2023
1 parent 94049c1 commit 82c8bde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 35 deletions.
29 changes: 0 additions & 29 deletions packages/end-to-end/cypress/e2e/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ describe('Tasks', () => {
after(() => {});

it('CheckTasksNavigation', () => {
// Confirm that location exists
cy.get('[data-cy=home-farmButton]')
.should('exist')
.and('not.be.disabled')
.click({ force: true });
cy.get('[data-cy=navbar-option]')
.eq(1)
.should('exist')
.and('not.be.disabled')
.click({ force: true });
cy.contains('First Field').should('be.visible');

// Add a crop variety
cy.get('[data-cy=navbar-hamburger]').should('exist').click();
cy.contains(translation['SLIDE_MENU']['TASKS']).should('exist').click();
cy.contains(translation['TASK']['ADD_TASK']).should('exist').and('not.be.disabled');
Expand All @@ -64,23 +51,7 @@ describe('Tasks', () => {
});

it('CreateCleanTask', () => {
// Confirm that location exists
cy.get('[data-cy=home-farmButton]')
.should('exist')
.and('not.be.disabled')
.click({ force: true });
cy.get('[data-cy=navbar-option]')
.eq(1)
.should('exist')
.and('not.be.disabled')
.click({ force: true });
cy.contains('First Field').should('be.visible');
cy.get('[data-cy=navbar-hamburger]').should('exist').click();
cy.contains(translation['SLIDE_MENU']['TASKS']).should('exist').click();
cy.waitForReact();

cy.contains(translation['TASK']['ADD_TASK']).should('exist').and('not.be.disabled').click();

cy.contains(tasks['CLEANING_TASK']).should('exist').click();

//Create an unassigned cleaning task due tomorrow
Expand Down
15 changes: 9 additions & 6 deletions packages/end-to-end/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,17 @@ Cypress.Commands.add('createFirstLocation', () => {
cy.get('[data-cy=spotlight-next]').should('exist').and('not.be.disabled').click();
cy.get('[data-cy=map-addFeature]').should('exist').and('not.be.disabled').click();

cy.contains('Field').should('be.visible').click();

cy.get('[data-cy="map-selection"]').should('be.visible');

cy.get('[data-cy=map-drawer]').should('exist').and('not.be.disabled').click();
// cy.get('[data-cy=map-drawer]').should('exist').and('not.be.disabled').click();

cy.get('[data-cy=map-mapContainer]', { timeout: 60 * 1000 })
.find('button', { timeout: 60 * 1000 })
.eq(2)
.should('exist')
.and('be.visible');
// cy.get('[data-cy=map-mapContainer]', { timeout: 60 * 1000 })
// .find('button', { timeout: 60 * 1000 })
// .eq(2)
// .should('exist')
// .and('be.visible');
cy.get('[data-cy=mapTutorial-continue]').should('exist').and('not.be.disabled').click();

cy.get('[data-cy=map-mapContainer]').click(500, 300);
Expand All @@ -193,6 +195,7 @@ Cypress.Commands.add('createFirstLocation', () => {
cy.get('[data-cy=createField-save]').should('exist').and('not.be.disabled').click();

cy.get('[data-cy=snackBar').should('exist').and('be.visible');
cy.get('div[data-cy="snackBar"]').find('[class*="button"]:first').click();

cy.waitForReact();

Expand Down

0 comments on commit 82c8bde

Please sign in to comment.