vendredi 5 février 2021

Unable to find link "New country" (Capybara::ElementNotFound)

Please, help! I run the test (cucumber) and it gives this error : Unable to find link "New country" (Capybara::ElementNotFound)

    <% content_for :page_header do %>
  <% render partial: "layouts/app_page_header" , locals: { page_title: "Countries" } %>
<% end %>

<div class="flex flex-col">
  <div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
    <div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
      <div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
        <table class="min-w-full divide-y divide-gray-200">
          <thead>
            <tr>
              <th scope="col" class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                Country code
              </th>
              <th scope="col" class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                Country name
              </th>
              <th scope="col" class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                Cities count
              </th>
              <th scope="col" class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                Legal forms count
              </th>
              <th scope="col" class="px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
                Taxation forms count
              </th>
              <th scope="col" class="px-6 py-3 bg-gray-50">
                <span class="sr-only">Actions</span>
              </th>
            </tr>
          </thead>

          <tbody class="bg-white divide-y divide-gray-200" id="countries">
            <%= render @countries %>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div> <br>

<%= link_to t('.new_country_button'), new_admin_country_path, id:'new_admin_country_submit', class: 'btn btn-primary' %>

<p>
  <%== render partial: "shared/pagy" , locals: {pagy: @pagy} if @pagy.pages> 1 %>
</p>

when I enter "print page.html" it shows that I am on the correct page and I don’t understand why I don’t find the "New country" button I need

Aucun commentaire:

Enregistrer un commentaire