Commit 1d562121 authored by Mark Lapierre's avatar Mark Lapierre Committed by Ramya Authappan

SSH Key E2E updates

- In the test check for the full key title
- Expire keys automatically when created via the API
- Add the `dry_run` rake task param
parent 932f5927
......@@ -42,12 +42,6 @@ desc "Generate data and run load tests"
task generate_data_and_run_load_test: [:generate_perf_testdata, :run_artillery_load_tests]
desc "Deletes test ssh keys a user"
task :delete_test_ssh_keys, [:title_portion, :delete_before] do |t, args|
QA::Tools::DeleteTestSSHKeys.new(args).run
end
desc "Dry run of deleting test ssh keys for a user. Lists keys to be deleted"
task :delete_test_ssh_keys_dry_run, [:title_portion, :delete_before] do |t, args|
args.with_defaults(dry_run: true)
task :delete_test_ssh_keys, [:title_portion, :delete_before, :dry_run] do |t, args|
QA::Tools::DeleteTestSSHKeys.new(args).run
end
......@@ -14,6 +14,7 @@ module QA
def initialize
self.title = Time.now.to_f
@expires_at = Date.today + 2
end
def key
......
......@@ -24,10 +24,10 @@ module QA
Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys|
ssh_keys.remove_key(key_title)
ssh_keys.remove_key(key.title)
end
expect(page).not_to have_content("Title: #{key_title}")
expect(page).not_to have_content("Title: #{key.title}")
expect(page).not_to have_content(key.md5_fingerprint)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment