@frontend_royalties
@lambda_documents
@documents
@graphql_tax_payment
@lambda_documents_payee
Feature: ES Tax Form

  @id_dc92ee05b73d53b1f0b49ea554af8e520b867ea0f9282b82192e2756b41103f5
  Scenario: Add Spain as country of Tax Residence for Business account and mainland
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update banking_details_review to approved
    Then I'm able to delete tax details
    Then I'm able to add Tax details for es_eur as Business Account type
    And I set Spanish area to Mainland, Balearic Islands
    And I submit Tax Details
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    Then I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can see Tax information with country of residence for es_eur as Business Account
    Then I log out of Abacus

  @id_d7fbea71bc8ef24efd0d0f03d3b1cc7cc79a98f85e3f875a14454726e6865835
  Scenario: Add Spain as country of Tax Residence for Personal account and Canary island
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I'm able to delete tax details
    Then I'm able to add Tax details for es_eur as Personal Account type
    And I set Spanish area to Canary Islands, Ceuta, Melilla
    And I submit Tax Details
    And I'm able to see submitted Tax details as Personal Account type
    Then I edit Tax Details for es_eur as Business Account type
    And I'm able to see submitted Tax details as Business Account type
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    Then I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can see Tax information with country of residence for es_eur as Business Account
    Then I log out of Abacus

  @id_280698f901e0dcf92272e33f1c4784014eba4475d3dd60d63eeb6bb0be043fda
  Scenario: Not Spanish Tax resident
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update banking_details_review to approved
    Then I'm able to delete tax details
    Then I click on button I’m not a Spanish resident
    And I can see text in modal window If you are a resident of Spain
    Then I click on button confirm
    When I click on button I made a mistake, I'm a Spanish resident
    Then I can see text in modal window If you are not a resident of Spain
    And I click on button confirm
    Then I log out of documents

  @id_280698f901e0dcf92272e33f1c4784014eba4475d3dd60d63eeb6bb0be043fda
  Scenario: Not Spanish Tax with expired certificate
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    Then I update banking_details_review to approved
    Then I'm able to delete tax details
    Then I click on button I’m not a Spanish resident
    And I can see text in modal window If you are a resident of Spain
    Then I click on button confirm
    When I click on button I made a mistake, I'm a Spanish resident
    Then I can see text in modal window If you are not a resident of Spain
    And I click on button confirm
    Then I log out of documents
    Given an orchard employee label_7123_admin_1 for abacus ignoring host override
    When I log in to Abacus
    Then I am successfully logged in to Abacus
    Then I can find account by account name and go to info tab orchard_es_test_pw
    And I can add tax details from Abacus without expired certificate
    Then I edit submitted tax details
    Then I can add tax details from Abacus with expired certificate
    Then I log out of Abacus
    Given an orchard employee label_6971 for documents
    When I log in to documents
    Then I am successfully logged in to documents
    Then I can see that documents Banking & Tax Settings page works with whitelabel account name orchard_es_test_pw
    And I check eligibility status in documents as Ineligible
    Then I log out of documents
