blob: dcf52f7c744ac5b48f3610f3d1276ada9dc4cae1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
context 'Wiki' do
let(:small_number_of_pages) { 5 }
let(:large_number_of_pages) { 15 }
let(:random_page) { "bulk_#{rand(0..4)}" }
let(:small_wiki) { create_wiki_pages small_number_of_pages }
let(:large_wiki) { create_wiki_pages large_number_of_pages }
before do
Flow::Login.sign_in
end
context 'Sidebar' do
it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/903' do
small_wiki.visit!
small_number_of_pages.times do |index|
Page::Project::Wiki::Show.perform do |list|
expect(list).to have_page_listed "bulk_#{index}"
end
end
Page::Project::Wiki::Show.perform do |list|
list.click_page_link random_page
end
Page::Project::Wiki::Show.perform do |wiki|
expect(wiki).to have_title random_page
end
end
end
context 'Page List' do
it 'has all expected links that work', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/902' do
large_wiki.visit!
Page::Project::Wiki::Show.perform(&:click_view_all_pages)
large_number_of_pages.times do |index|
Page::Project::Wiki::List.perform do |list|
expect(list).to have_page_listed "bulk_#{index}"
end
end
Page::Project::Wiki::List.perform do |list|
list.click_page_link random_page
end
Page::Project::Wiki::Show.perform do |wiki|
expect(wiki).to have_title random_page
end
end
end
private
def create_wiki_pages(no_of_pages)
wiki = Resource::Wiki::ProjectPage.fabricate_via_api!
no_of_pages.times do |index|
Resource::Wiki::ProjectPage.fabricate_via_api! do |page|
page.title = "bulk_#{index}"
page.project = wiki.project
end
end
wiki
end
end
end
end
|