- ['My Virtual Machines', nil, 'Host name'],
- ['My Repositories', 'Add new repository', 'It may take a minute or two before you can clone your new repository.'],
- ['My SSH Keys', 'Add new SSH key', 'Click here to learn about SSH keys in Arvados.'],
- ['My Current Token', nil, 'HISTIGNORE=$HISTIGNORE'],
- ].each do |page_name, button_name, look_for|
- test "test notification menu for page #{page_name}" do
- visit page_with_token('admin')
- within('.navbar-fixed-top') do
- page.find("#notifications-menu").click
- within('.dropdown-menu') do
- assert_selector 'a', text: page_name
- find('a', text: page_name).click
- end
+ ['active', false],
+ ['admin', true],
+ ].each do |token, is_admin|
+ test "visit dashboard as #{token}" do
+ visit page_with_token(token)
+
+ assert_text 'Recent pipelines and processes' # seeing dashboard now
+ within('.recent-processes-actions') do
+ assert page.has_link?('Run a pipeline')
+ assert page.has_link?('All pipelines')
+ end
+
+ within('.recent-processes') do
+ assert_text 'running_with_job'
+ within('.row-zzzzz-d1hrv-runningpipeline') do
+ assert_text 'foo'
+ end
+
+ assert_text 'zzzzz-d1hrv-twodonepipeline'
+ within('.row-zzzzz-d1hrv-twodonepipeline')do
+ assert_text 'No output'
+ end
+
+ assert_text 'completed container request'
+ within('.row-zzzzz-xvhdp-cr4completedctr')do
+ assert page.has_link? 'foo_file'
+ end
+ end
+
+ within('.compute-node-actions') do
+ if is_admin
+ assert page.has_link?('All nodes')
+ else
+ assert page.has_no_link?('All nodes')
+ end
+ assert page.has_link? 'All jobs'
+ end
+
+ within('.compute-node-summary-pane') do
+ click_link 'Details'
+ assert_text 'compute0'
+ end
+ end
+ end
+
+ [
+ ['jobs', 'running_job_with_components', true],
+ ['pipeline_instances', 'components_is_jobspec', false],
+ ['containers', 'running', false],
+ ['container_requests', 'running', true],
+ ].each do |type, fixture, cancelable|
+ test "cancel button for #{type}/#{fixture}" do
+ if cancelable
+ need_selenium 'to cancel'