very basic system tests
All checks were successful
/ Text (push) Successful in 1m4s
/ Checkout (push) Successful in 1m11s

This commit is contained in:
david 2024-07-23 01:06:45 +02:00
parent 345a932514
commit c31d4266cd
12 changed files with 114 additions and 185 deletions

View file

@ -1,45 +0,0 @@
require "application_system_test_case"
class ChecklistEntriesTest < ApplicationSystemTestCase
setup do
@checklist_entry = checklist_entries(:one)
end
test "visiting the index" do
visit checklist_entries_url
assert_selector "h1", text: "Checklist entries"
end
test "should create checklist entry" do
visit checklist_entries_url
click_on "New checklist entry"
fill_in "Check", with: @checklist_entry.check_id
fill_in "Checklist", with: @checklist_entry.checklist_id
fill_in "Position", with: @checklist_entry.position
click_on "Create Checklist entry"
assert_text "Checklist entry was successfully created"
click_on "Back"
end
test "should update Checklist entry" do
visit checklist_entry_url(@checklist_entry)
click_on "Edit this checklist entry", match: :first
fill_in "Check", with: @checklist_entry.check_id
fill_in "Checklist", with: @checklist_entry.checklist_id
fill_in "Position", with: @checklist_entry.position
click_on "Update Checklist entry"
assert_text "Checklist entry was successfully updated"
click_on "Back"
end
test "should destroy Checklist entry" do
visit checklist_entry_url(@checklist_entry)
click_on "Destroy this checklist entry", match: :first
assert_text "Checklist entry was successfully destroyed"
end
end

View file

@ -1,45 +1,35 @@
require "application_system_test_case"
require 'application_system_test_case'
class ChecklistsTest < ApplicationSystemTestCase
setup do
@checklist = checklists(:one)
end
test "visiting the index" do
test 'visiting the index' do
visit checklists_url
assert_selector "h1", text: "Checklists"
assert_selector 'h1', text: 'Checklisten'
end
test "should create checklist" do
test 'should create checklist' do
visit checklists_url
click_on "New checklist"
click_on 'Checkliste hinzufügen'
fill_in "Code", with: @checklist.code
fill_in "Description", with: @checklist.description
fill_in "Name", with: @checklist.name
click_on "Create Checklist"
assert_text "Checklist was successfully created"
click_on "Back"
fill_in_rich_text_area 'Details', with: @checklist.description
fill_in 'Überschrift', with: @checklist.name
click_on 'Checkliste erstellen'
end
test "should update Checklist" do
test 'should update Checkliste' do
visit checklist_url(@checklist)
click_on "Edit this checklist", match: :first
click_on 'Checkliste bearbeiten', match: :first
fill_in "Code", with: @checklist.code
fill_in "Description", with: @checklist.description
fill_in "Name", with: @checklist.name
click_on "Update Checklist"
assert_text "Checklist was successfully updated"
click_on "Back"
fill_in_rich_text_area 'Details', with: @checklist.description
fill_in 'Überschrift', with: @checklist.name
click_on 'Checkliste aktualisieren'
end
test "should destroy Checklist" do
test 'should destroy Checkliste' do
visit checklist_url(@checklist)
click_on "Destroy this checklist", match: :first
assert_text "Checklist was successfully destroyed"
click_on 'Checkliste löschen', match: :first
end
end

View file

@ -1,47 +1,40 @@
require "application_system_test_case"
require 'application_system_test_case'
class ChecksTest < ApplicationSystemTestCase
setup do
@check = checks(:one)
@deletable_check = checks(:deletable)
end
test "visiting the index" do
test 'visiting the index' do
visit checks_url
assert_selector "h1", text: "Checks"
assert_selector 'h1', text: 'Checks'
end
test "should create check" do
test 'should create check' do
visit checks_url
click_on "New check"
click_on 'Check hinzufügen'
fill_in "Level", with: @check.level
fill_in "Name", with: @check.name
fill_in "Position", with: @check.position
fill_in "Success criterion", with: @check.success_criterion
click_on "Create Check"
assert_text "Check was successfully created"
click_on "Back"
select 'AAA', from: 'Stufe'
fill_in 'Name', with: @check.name
fill_in 'Position', with: @check.position
fill_in_rich_text_area 'Erfolgskriterium', with: @check.success_criterion_html
click_on 'Check erstellen'
end
test "should update Check" do
test 'should update Check' do
visit check_url(@check)
click_on "Edit this check", match: :first
click_on 'Check bearbeiten', match: :first
fill_in "Level", with: @check.level
fill_in "Name", with: @check.name
fill_in "Position", with: @check.position
fill_in "Success criterion", with: @check.success_criterion
click_on "Update Check"
assert_text "Check was successfully updated"
click_on "Back"
select 'AAA', from: 'Stufe'
fill_in 'Name', with: @check.name
fill_in 'Position', with: @check.position
fill_in_rich_text_area 'Erfolgskriterium', with: @check.success_criterion_html
click_on 'Check aktualisieren'
end
test "should destroy Check" do
visit check_url(@check)
click_on "Destroy this check", match: :first
assert_text "Check was successfully destroyed"
test 'should destroy Check' do
visit check_url(@deletable_check)
click_on 'Check löschen', match: :first
end
end

View file

@ -1,47 +1,37 @@
require "application_system_test_case"
require 'application_system_test_case'
class ElementsTest < ApplicationSystemTestCase
setup do
@element = elements(:one)
end
test "visiting the index" do
test 'visiting the index' do
visit elements_url
assert_selector "h1", text: "Elements"
assert_selector 'h1', text: 'Elemente'
end
test "should create element" do
test 'should create element' do
visit elements_url
click_on "New element"
click_on 'Element hinzufügen'
fill_in "Description", with: @element.description
fill_in "Path", with: @element.path
fill_in "Report", with: @element.report_id
fill_in "Title", with: @element.title
click_on "Create Element"
assert_text "Element was successfully created"
click_on "Back"
fill_in_rich_text_area 'Details', with: @element.description
fill_in 'Pfad', with: @element.path
fill_in 'Beschreibung', with: @element.title
click_on 'Element erstellen'
end
test "should update Element" do
test 'should update Element' do
visit element_url(@element)
click_on "Edit this element", match: :first
click_on 'Element bearbeiten', match: :first
fill_in "Description", with: @element.description
fill_in "Path", with: @element.path
fill_in "Report", with: @element.report_id
fill_in "Title", with: @element.title
click_on "Update Element"
assert_text "Element was successfully updated"
click_on "Back"
fill_in_rich_text_area 'Details', with: @element.description
fill_in 'Pfad', with: @element.path
fill_in 'Beschreibung', with: @element.title
click_on 'Element aktualisieren'
end
test "should destroy Element" do
test 'should destroy Element' do
visit element_url(@element)
click_on "Destroy this element", match: :first
assert_text "Element was successfully destroyed"
click_on 'Element löschen', match: :first
end
end

View file

@ -1,43 +1,35 @@
require "application_system_test_case"
require 'application_system_test_case'
class ReportsTest < ApplicationSystemTestCase
setup do
@report = reports(:one)
end
test "visiting the index" do
test 'visiting the index' do
visit reports_url
assert_selector "h1", text: "Reports"
assert_selector 'h1', text: 'Prüfberichte'
end
test "should create report" do
test 'should create report' do
visit reports_url
click_on "New report"
click_on 'Prüfbericht hinzufügen'
fill_in "Comment", with: @report.comment
fill_in "Name", with: @report.name
click_on "Create Report"
assert_text "Report was successfully created"
click_on "Back"
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
fill_in 'Bezeichnung', with: @report.name
click_on 'Prüfbericht erstellen'
end
test "should update Report" do
test 'should update Report' do
visit report_url(@report)
click_on "Edit this report", match: :first
click_on 'Prüfbericht bearbeiten', match: :first
fill_in "Comment", with: @report.comment
fill_in "Name", with: @report.name
click_on "Update Report"
assert_text "Report was successfully updated"
click_on "Back"
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
fill_in 'Bezeichnung', with: @report.name
click_on 'Prüfbericht aktualisieren'
end
test "should destroy Report" do
test 'should destroy Report' do
visit report_url(@report)
click_on "Destroy this report", match: :first
assert_text "Report was successfully destroyed"
click_on 'Prüfbericht löschen', match: :first
end
end

View file

@ -1,51 +1,44 @@
require "application_system_test_case"
require 'application_system_test_case'
class SuccessCriteriaTest < ApplicationSystemTestCase
setup do
@success_criterion = success_criteria(:one)
end
test "visiting the index" do
test 'visiting the index' do
visit success_criteria_url
assert_selector "h1", text: "Success criteria"
assert_selector 'h1', text: 'Erfolgskriterien'
end
test "should create success criterion" do
test 'should create Erfolgskriterium' do
visit success_criteria_url
click_on "New success criterion"
click_on 'Erfolgskriterium hinzufügen'
fill_in "Comment", with: @success_criterion.comment
fill_in "Description", with: @success_criterion.description
fill_in "Element", with: @success_criterion.element_id
fill_in "Level", with: @success_criterion.level
fill_in "Result", with: @success_criterion.result
fill_in "Title", with: @success_criterion.title
click_on "Create Success criterion"
assert_text "Success criterion was successfully created"
click_on "Back"
fill_in_rich_text_area 'Testkommentar', with: @success_criterion.comment
fill_in_rich_text_area 'Richtlinie', with: @success_criterion.description
# fill_in 'Element', with: @success_criterion.element_id
# fill_in 'Level', with: @success_criterion.level
# fill_in 'Result', with: @success_criterion.result
# fill_in 'Title', with: @success_criterion.title
click_on 'Erfolgskriterium erstellen'
end
test "should update Success criterion" do
test 'should update Erfolgskriterium' do
visit success_criterion_url(@success_criterion)
click_on "Edit this success criterion", match: :first
click_on 'Erfolgskriterium bearbeiten', match: :first
fill_in "Comment", with: @success_criterion.comment
fill_in "Description", with: @success_criterion.description
fill_in "Element", with: @success_criterion.element_id
fill_in "Level", with: @success_criterion.level
fill_in "Result", with: @success_criterion.result
fill_in "Title", with: @success_criterion.title
click_on "Update Success criterion"
fill_in_rich_text_area 'Testkommentar', with: @success_criterion.comment_html
fill_in_rich_text_area 'Richtlinie', with: @success_criterion.description
find('label', text: 'Bestanden', visible: true).click
fill_in 'Titel', with: 'new'
click_on 'Erfolgskriterium aktualisieren'
assert_text "Success criterion was successfully updated"
click_on "Back"
# assert_text 'Erfolgskriterium was successfully updated'
# click_on 'Back'
end
test "should destroy Success criterion" do
test 'should destroy Erfolgskriterium' do
visit success_criterion_url(@success_criterion)
click_on "Destroy this success criterion", match: :first
assert_text "Success criterion was successfully destroyed"
click_on 'Erfolgskriterium löschen', match: :first
end
end