Merge pull request #6513 from mvrazic/mv_SCI_9581

Modified and added e2e tags mostly for inventories section.
This commit is contained in:
Martin Artnik 2023-10-23 11:11:57 +02:00 committed by GitHub
commit 475a1fbd46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 28 additions and 26 deletions

View file

@ -17,7 +17,7 @@ var DasboardRecentWorkWidget = (function() {
recentWorkItemType.attr('title', `${item.type} ID: ${item.code}`);
recentWorkItemType.tooltip();
}
recentWorkItemType.attr('data-e2e', `e2e-dashRecentWork-${item.name}`);
recentWorkItemType.attr('data-e2e', `e2e-TL-dashRecentWork-${item.name}`);
});
}

View file

@ -67,7 +67,7 @@
orderable: false,
render: function() {
return `<div class="sci-checkbox-container">
<input class='repository-row-selector sci-checkbox' type='checkbox' data-e2e='e2e-inventories-inventoryCheckbox'>
<input class='repository-row-selector sci-checkbox' type='checkbox' data-e2e="e2e-CB-inventory">
<span class='sci-checkbox-label'></span>
</div>`;
}
@ -75,7 +75,7 @@
targets: 1,
className: 'item-name',
render: function(value, type, row) {
return `<a href="${row.repositoryUrl}">${value}</a>`;
return `<a href="${row.repositoryUrl}" data-e2e="e2e-TL-inventories-${value}">${value}</a>`;
}
}, {
targets: 5,

View file

@ -671,7 +671,7 @@ var RepositoryDatatable = (function(global) {
visible: true,
render: function(data, type, row) {
return "<a href='" + row.recordInfoUrl + "'"
+ "class='record-info-link'>" + data + '</a>';
+ "class='record-info-link' data-e2e='e2e-TL-invInventory-" + data + "'>" + data + '</a>';
}
}, {
// Added on column

View file

@ -29,7 +29,8 @@ module RepositoriesDatatableHelper
'data-copy-modal-url': team_repository_copy_modal_path(team, repository_id: repository),
'data-rename-modal-url': team_repository_rename_modal_path(team, repository_id: repository),
'data-shared': repository.shared_with?(team),
'data-i-shared': repository.i_shared?(team)
'data-i-shared': repository.i_shared?(team),
'data-e2e': "e2e-RT-inventories-tableItemRow-#{repository.id}"
}
)
end

View file

@ -16,7 +16,7 @@ module RepositoryDatatableHelper
row = public_send("#{repository.class.name.underscore}_default_columns", record)
row.merge!(
DT_RowId: record.id,
DT_RowAttr: { 'data-state': row_style(record) },
DT_RowAttr: { 'data-state': row_style(record), 'data-e2e': "e2e-RT-invInventory-row-#{record.id}" },
recordInfoUrl: Rails.application.routes.url_helpers.repository_repository_row_path(repository, record),
rowRemindersUrl:
Rails.application.routes.url_helpers

View file

@ -1,4 +1,4 @@
<div class="quick-start-buttons">
<div class="quick-start-buttons" data-e2e="e2e-CO-dashboard-quickStartButtons" >
<div class="new-task btn btn-secondary"><i class="sn-icon sn-icon-new-task"></i><%= t("dashboard.quick_start.new_task") %></div>
<% if can_create_protocols_in_repository?(current_team) %>
<button data-toggle="modal" data-target="#newProtocolModal" class="btn btn-secondary">

View file

@ -12,7 +12,7 @@
</div>
</div>
<div class="widget-body">
<div class="recent-work-container perfect-scrollbar" data-url="<%= dashboard_recent_works_path %>"></div>
<div class="recent-work-container perfect-scrollbar" data-url="<%= dashboard_recent_works_path %>" data-e2e="e2e-CO-dashboard-recentWork"></div>
</div>
</div>

View file

@ -1,7 +1,7 @@
<% provide :head_title, t('nav.label.dashboard') %>
<% if current_team %>
<div class="dashboard-view" data-e2e="e2e-dashboard-container">
<div class="dashboard-view" data-e2e="e2e-CO-dashboard">
<div class="dashboard-background"></div>
<div class="dashboard-header">
<%= render partial: 'quick_start' %>

View file

@ -80,7 +80,7 @@
<div class="sci--layout-navigation-left">
<%= render "shared/navigation/left" if user_signed_in? %>
</div>
<div class="sci--layout-navigation-navigator overflow-hidden relative" data-e2e="e2e-projects-navigator-container">
<div class="sci--layout-navigation-navigator overflow-hidden relative" data-e2e="e2e-CO-projects-navigator">
<%= render "shared/navigation/navigator" %>
</div>
<div class="sci--layout-navigation-breadcrumbs">

View file

@ -1,13 +1,13 @@
<div id="projectsToolbar" class="projects-toolbar">
<div class="form-inline">
<div class="project-actions">
<div class="project-actions" data-e2e="e2e-CO-projects-actionsToolbar">
<span class="left">
<!-- new project button -->
<% if current_team && can_create_projects?(current_team) %>
<%= link_to new_project_path(project_folder_id: current_folder),
class: 'btn btn-primary new-project-btn',
title: t('projects.index.new_tooltip'),
data: { view_mode: 'active', e2e: 'e2e-new-project-button' },
data: { view_mode: 'active', e2e: 'e2e-BT-project-newProject' },
remote: true do %>
<span class="sn-icon sn-icon-new-task" aria-hidden="true"></span>
<span class="hidden-xs"><%= t('projects.index.new') %></span>

View file

@ -1,16 +1,16 @@
<div class="modal" id="create-repo-modal" tabindex="-1" role="dialog" aria-labelledby="create-repo-modal-label">
<%= form_with model: @repository, url: repositories_path, html: { data: { remote: true } } do |f| %>
<div class="modal-dialog" role="document">
<div class="modal-dialog" role="document" data-e2e="e2e-MD-invNewInventory">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close"></i></button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" data-e2e="e2e-BT-invNewInventory-close"><i class="sn-icon sn-icon-close"></i></button>
<h3 class="modal-title" id="create-repo-modal-label">
<%= t("repositories.index.modal_create.title") %>
</h3>
</div>
<div class="modal-body">
<div class="form-group sci-input-container">
<label><%= t("repositories.index.modal_create.name_label") %></label>
<div class="form-group sci-input-container" data-e2e="e2e-IF-invNewInventory-input">
<label><%= t("repositories.index.modal_create.name_label") %> </label>
<%= f.text_field :name,
autofocus: true,
class: "sci-input-field",
@ -18,8 +18,8 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
<%= f.submit t("repositories.index.modal_create.submit"), class: "btn btn-success" %>
<button type="button" data-e2e="e2e-BT-invNewInventory-cancel" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
<%= f.submit t("repositories.index.modal_create.submit"), class: "btn btn-success", 'data-e2e':"e2e-BT-invNewInventory-create" %>
</div>
</div>
</div>

View file

@ -1,8 +1,8 @@
<div class="modal fade" id="modal-info-repository-row" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-content" data-e2e="e2e-MD-invInventoryItem">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close"></i></button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close" data-e2e="e2e-BT-invInventoryItem-cancel"></i></button>
<h4 class="modal-title">
<%= t('repository_row.modal_info.head_title', repository_row: @repository_row.name) %>
<%= @repository_row.archived? ? I18n.t('atwho.res.archived') : '' %>
@ -138,8 +138,8 @@
</button>
</span>
<% else %>
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%= t('general.close')%></button>
<button type="button" class="btn btn-primary print-label-button" data-rows="[<%= @repository_row.id %>]"><%= t('repository_row.modal_print_label.print_label') %></button>
<button data-e2e="e2e-BT-invInventoryItem-close" type="button" class="btn btn-secondary" data-dismiss="modal"><%= t('general.close')%></button>
<button data-e2e="e2e-BT-invInventoryItem-print" type="button" class="btn btn-primary print-label-button" data-rows="[<%= @repository_row.id %>]"><%= t('repository_row.modal_print_label.print_label') %></button>
<% end %>
</div>
</div>

View file

@ -27,7 +27,7 @@
data-snapshot-provisioning="<%= @snapshot_provisioning %>"
data-status-url="<%= repository_status_path(@repository) %>">
<thead>
<tr class="repository-table-head-<%= repository.id %> hidden" >
<tr class="repository-table-head-<%= repository.id %> hidden" data-e2e="e2e-RT-invInventory-tableHeadRow-<%= repository.id %>">
<th id="checkbox" data-unmanageable="true">
<div class="sci-checkbox-container">
<input name="select_all" value="1" type="checkbox" class="sci-checkbox">

View file

@ -1,4 +1,5 @@
<div
data-e2e="e2e-CO-invInventory-<%= config[:item_id] %>"
class="inline-editing-container inline-init-handler"
data-field-to-update="<%= config[:field_to_udpate] %>"
data-params-group="<%= config[:params_group] %>"

View file

@ -5,7 +5,7 @@
</a>
</div>
<% left_menu_elements.each_with_index do |item, index| %>
<%= link_to item[:url], title: item[:name], class:"sci--layout--menu-item", data: { e2e: "e2e-left-menu-item-#{item[:name].downcase}", active: item[:submenu].blank? && item[:active], disabled: current_user.teams.blank?, submenu: item[:submenu].any? } do %>
<%= link_to item[:url], title: item[:name], class:"sci--layout--menu-item", data: { e2e: "e2e-BT-leftMenu-#{item[:name].downcase}", active: item[:submenu].blank? && item[:active], disabled: current_user.teams.blank?, submenu: item[:submenu].any? } do %>
<i class="sn-icon <%= item[:icon] %>"></i>
<%= item[:name] %>
<i class="sn-icon <%= item[:active] ? 'sn-icon-down' : 'sn-icon-right' %> show-submenu"></i>
@ -13,7 +13,7 @@
<% if item[:submenu].any? %>
<div class="sci--layout--menu-submenu" data-id="<%= index %>" data-collapsed="<%= !item[:active] %>" style="--submenu-items:<%= item[:submenu].length %>">
<% item[:submenu].each do |subitem| %>
<%= link_to subitem[:url], title: subitem[:name], class:"sci--layout--menu-item", data: { e2e: "e2e-left-menu-item-#{subitem[:name].downcase}", active: subitem[:active], disabled: current_user.teams.blank? } do %>
<%= link_to subitem[:url], title: subitem[:name], class:"sci--layout--menu-item", data: { e2e: "e2e-BT-leftMenu-#{item[:name].downcase}-#{subitem[:name].downcase}", active: subitem[:active], disabled: current_user.teams.blank? } do %>
<i class="sn-icon sn-icon-dot-small"></i>
<%= subitem[:name] %>
<% end %>

View file

@ -1,6 +1,6 @@
<% provide(:head_title, t("devise.sessions.new.head_title")) %>
<% content_for(:body_class, 'sign-in-layout') %>
<div class="sign-in-container" data-e2e="e2e-signin-container">
<div class="sign-in-container" data-e2e="e2e-CO-signin">
<div class="sign-in-form-wrapper">
<div class="center-block center-block-narrow">
<h1 class="log-in-title"><%=t "devise.sessions.new.title" %></h1>