Skip to content

Commit

Permalink
Add tests for donate/request medicine and sanitary items
Browse files Browse the repository at this point in the history
  • Loading branch information
cipick committed Apr 1, 2022
1 parent 078e482 commit f431512
Show file tree
Hide file tree
Showing 11 changed files with 30,914 additions and 150 deletions.
14 changes: 14 additions & 0 deletions cypress/integration/Donate/DonateItem.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ Feature: Donate Item Resources
Then I see the thank you for donation message
And donate item is created

Scenario: Donate Medicine item
Given I click donate medicine button
And I fill the donate medicine form
And I submit the form
Then I see the thank you for donation message
And donate item is created

Scenario: Donate Sanitary item
Given I click donate sanitary item button
And I fill the donate sanitary item form
And I submit the form
Then I see the thank you for donation message
And donate item is created

Scenario: Donate Tent item
Given I click donate tent button
And I fill the donate tent form
Expand Down
17 changes: 17 additions & 0 deletions cypress/integration/Donate/DonateItem/6_medicine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click donate medicine button$/, function () {
cy.findAllByText('Adaugă').eq(5).click()
cy.wait(1000)
})

Given(/^I fill the donate medicine form$/, function () {
cy.get('#has_transportation_true').check()
cy.selectMultiDropdown()
cy.get('#town').type('Galati')
cy.get('#name').type('Product name')
cy.get('#description').type('Product description')
cy.get('#quantity').type(100)
cy.get('#unit_type').type('box')
cy.get('#packaging_type').type('bax')
})
17 changes: 17 additions & 0 deletions cypress/integration/Donate/DonateItem/7_sanitary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click donate sanitary item button$/, function () {
cy.findAllByText('Adaugă').eq(6).click()
cy.wait(1000)
})

Given(/^I fill the donate sanitary item form$/, function () {
cy.get('#has_transportation_true').check()
cy.selectMultiDropdown()
cy.get('#town').type('Galati')
cy.get('#name').type('Product name')
cy.get('#description').type('Product description')
cy.get('#quantity').type(100)
cy.get('#unit_type').type('box')
cy.get('#packaging_type').type('bax')
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click donate tent button$/, function () {
cy.findAllByText('Adaugă').eq(5).click()
cy.findAllByText('Adaugă').eq(7).click()
cy.wait(1000)
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click donate other item button$/, function () {
cy.findAllByText('Adaugă').eq(6).click()
cy.findAllByText('Adaugă').eq(8).click()
cy.wait(1000)
})

Expand Down
14 changes: 14 additions & 0 deletions cypress/integration/Request/RequestItem.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ Feature: Request Item Resources
Then I see the thank you for request message
And request item is created

Scenario: Request Medicine item
Given I click request medicine item button
And I fill the request medicine item form
And I submit the form
Then I see the thank you for request message
And request item is created

Scenario: Request Sanitary item
Given I click request sanitary item button
And I fill the request sanitary item form
And I submit the form
Then I see the thank you for request message
And request item is created

Scenario: Request Tent item
Given I click request tent button
And I fill the request tent form
Expand Down
17 changes: 17 additions & 0 deletions cypress/integration/Request/RequestItem/6_medicine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click request medicine item button$/, function() {
cy.findAllByText('Adaugă').eq(5).click()
cy.wait(1000)
});

Given(/^I fill the request medicine item form$/, function() {
cy.get('#has_transportation_true').check()
cy.get('select[name="county_coverage"]').select(1)
cy.get('#town').type('Galati')
cy.get('#name').type('Product name')
cy.get('#description').type('Product description')
cy.get('#quantity').type(100)
cy.get('#unit_type').type('box')
cy.get('#packaging_type').type('bax')
});
17 changes: 17 additions & 0 deletions cypress/integration/Request/RequestItem/7_sanitary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click request sanitary item button$/, function () {
cy.findAllByText('Adaugă').eq(6).click()
cy.wait(1000)
})

Given(/^I fill the request sanitary item form$/, function () {
cy.get('#has_transportation_true').check()
cy.get('select[name="county_coverage"]').select(1)
cy.get('#town').type('Galati')
cy.get('#name').type('Product name')
cy.get('#description').type('Product description')
cy.get('#quantity').type(100)
cy.get('#unit_type').type('box')
cy.get('#packaging_type').type('bax')
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click request tent button$/, function() {
cy.findAllByText('Adaugă').eq(5).click()
cy.findAllByText('Adaugă').eq(7).click()
cy.wait(1000)
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'

Given(/^I click request other item button$/, function() {
cy.findAllByText('Adaugă').eq(6).click()
cy.findAllByText('Adaugă').eq(8).click()
cy.wait(1000)
});
Given(/^I fill the request other item form$/, function() {
Expand Down
Loading

0 comments on commit f431512

Please sign in to comment.