Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c1de6bd0
Commit
c1de6bd0
authored
Apr 08, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
f02d117b
ef278f6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
77 deletions
+91
-77
app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue
...scripts/pages/projects/forks/new/components/fork_form.vue
+2
-0
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
...d/on_demand_scans/components/on_demand_scans_form_spec.js
+67
-67
qa/qa/page/project/fork/new.rb
qa/qa/page/project/fork/new.rb
+12
-2
qa/qa/resource/fork.rb
qa/qa/resource/fork.rb
+7
-3
qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb
...reate/merge_request/merge_merge_request_from_fork_spec.rb
+3
-5
No files found.
app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue
View file @
c1de6bd0
...
...
@@ -218,6 +218,7 @@ export default {
id=
"fork-url"
v-model=
"selectedNamespace"
data-testid=
"fork-url-input"
data-qa-selector=
"fork_namespace_dropdown"
required
>
<
template
slot=
"first"
>
...
...
@@ -291,6 +292,7 @@ export default {
category=
"primary"
variant=
"confirm"
data-testid=
"submit-button"
data-qa-selector=
"fork_project_button"
:loading=
"isSaving"
>
{{ s__('ForkProject|Fork project') }}
...
...
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
View file @
c1de6bd0
...
...
@@ -60,7 +60,7 @@ const LOCAL_STORAGE_KEY = 'group/project/on-demand-scans-new-form';
describe
(
'
OnDemandScansForm
'
,
()
=>
{
let
localVue
;
let
subject
;
let
wrapper
;
let
requestHandlers
;
const
GlFormInputStub
=
stubComponent
(
GlFormInput
,
{
...
...
@@ -70,13 +70,13 @@ describe('OnDemandScansForm', () => {
template
:
'
<input />
'
,
});
const
findForm
=
()
=>
subject
.
find
(
GlForm
);
const
findByTestId
=
(
testId
)
=>
subject
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
findForm
=
()
=>
wrapper
.
find
(
GlForm
);
const
findByTestId
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
findNameInput
=
()
=>
findByTestId
(
'
dast-scan-name-input
'
);
const
findBranchInput
=
()
=>
findByTestId
(
'
dast-scan-branch-input
'
);
const
findDescriptionInput
=
()
=>
findByTestId
(
'
dast-scan-description-input
'
);
const
findScannerProfilesSelector
=
()
=>
subject
.
find
(
ScannerProfileSelector
);
const
findSiteProfilesSelector
=
()
=>
subject
.
find
(
SiteProfileSelector
);
const
findScannerProfilesSelector
=
()
=>
wrapper
.
find
(
ScannerProfileSelector
);
const
findSiteProfilesSelector
=
()
=>
wrapper
.
find
(
SiteProfileSelector
);
const
findAlert
=
()
=>
findByTestId
(
'
on-demand-scan-error
'
);
const
findProfilesConflictAlert
=
()
=>
findByTestId
(
'
on-demand-scans-profiles-conflict-alert
'
);
const
findSubmitButton
=
()
=>
findByTestId
(
'
on-demand-scan-submit-button
'
);
...
...
@@ -89,10 +89,10 @@ describe('OnDemandScansForm', () => {
findBranchInput
().
vm
.
$emit
(
'
input
'
,
'
some-other-branch
'
);
findScannerProfilesSelector
().
vm
.
$emit
(
'
input
'
,
passiveScannerProfile
.
id
);
findSiteProfilesSelector
().
vm
.
$emit
(
'
input
'
,
nonValidatedSiteProfile
.
id
);
return
subject
.
vm
.
$nextTick
();
return
wrapper
.
vm
.
$nextTick
();
};
const
setupSuccess
=
({
edit
=
false
}
=
{})
=>
{
subject
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
wrapper
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
data
:
{
[
edit
?
'
dastProfileUpdate
'
:
'
dastProfileCreate
'
]:
{
dastProfile
:
{
editPath
},
...
...
@@ -104,8 +104,8 @@ describe('OnDemandScansForm', () => {
return
setValidFormData
();
};
const
selectProfile
=
(
component
)
=>
async
(
profile
)
=>
{
subject
.
find
(
component
).
vm
.
$emit
(
'
input
'
,
profile
.
id
);
await
subject
.
vm
.
$nextTick
();
wrapper
.
find
(
component
).
vm
.
$emit
(
'
input
'
,
profile
.
id
);
await
wrapper
.
vm
.
$nextTick
();
};
const
selectScannerProfile
=
selectProfile
(
ScannerProfileSelector
);
const
selectSiteProfile
=
selectProfile
(
SiteProfileSelector
);
...
...
@@ -127,7 +127,7 @@ describe('OnDemandScansForm', () => {
]);
};
const
subjectMounter
Factory
=
(
mountFn
=
shallowMount
)
=>
(
options
=
{},
withHandlers
)
=>
{
const
createComponent
Factory
=
(
mountFn
=
shallowMount
)
=>
(
options
=
{},
withHandlers
)
=>
{
localVue
=
createLocalVue
();
let
defaultMocks
=
{
$apollo
:
{
...
...
@@ -144,7 +144,7 @@ describe('OnDemandScansForm', () => {
apolloProvider
=
createMockApolloProvider
(
withHandlers
);
defaultMocks
=
{};
}
subject
=
mountFn
(
wrapper
=
mountFn
(
OnDemandScansForm
,
merge
(
{},
...
...
@@ -180,8 +180,8 @@ describe('OnDemandScansForm', () => {
),
);
};
const
mountSubject
=
subjectMounter
Factory
(
mount
);
const
mountShallowSubject
=
subjectMounter
Factory
();
const
createComponent
=
createComponent
Factory
(
mount
);
const
createShallowComponent
=
createComponent
Factory
();
const
itClearsLocalStorage
=
()
=>
{
it
(
'
clears local storage
'
,
()
=>
{
...
...
@@ -190,20 +190,20 @@ describe('OnDemandScansForm', () => {
};
afterEach
(()
=>
{
subject
.
destroy
();
subject
=
null
;
wrapper
.
destroy
();
wrapper
=
null
;
localStorage
.
clear
();
});
describe
(
'
when creating a new scan
'
,
()
=>
{
it
(
'
renders properly
'
,
()
=>
{
mountSubjec
t
();
createComponen
t
();
expect
(
subject
.
text
()).
toContain
(
'
New on-demand DAST scan
'
);
expect
(
wrapper
.
text
()).
toContain
(
'
New on-demand DAST scan
'
);
});
it
(
'
populates the branch input with the default branch
'
,
()
=>
{
mountSubjec
t
();
createComponen
t
();
expect
(
findBranchInput
().
props
(
'
value
'
)).
toBe
(
defaultBranch
);
});
...
...
@@ -217,7 +217,7 @@ describe('OnDemandScansForm', () => {
`
(
'
sets loading state to $isLoading if scanner profiles loading is $scannerProfilesLoading and site profiles loading is $siteProfilesLoading
'
,
({
scannerProfilesLoading
,
siteProfilesLoading
,
isLoading
})
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
mocks
:
{
$apollo
:
{
queries
:
{
...
...
@@ -228,14 +228,14 @@ describe('OnDemandScansForm', () => {
},
});
expect
(
subject
.
find
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
expect
(
wrapper
.
find
(
GlSkeletonLoader
).
exists
()).
toBe
(
isLoading
);
},
);
});
describe
(
'
when editing an existing scan
'
,
()
=>
{
beforeEach
(()
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
propsData
:
{
dastScan
,
},
...
...
@@ -243,7 +243,7 @@ describe('OnDemandScansForm', () => {
});
it
(
'
sets the title properly
'
,
()
=>
{
expect
(
subject
.
text
()).
toContain
(
'
Edit on-demand DAST scan
'
);
expect
(
wrapper
.
text
()).
toContain
(
'
Edit on-demand DAST scan
'
);
});
it
(
'
populates the fields with passed values
'
,
()
=>
{
...
...
@@ -257,7 +257,7 @@ describe('OnDemandScansForm', () => {
describe
(
'
local storage
'
,
()
=>
{
it
(
'
get updated when form is modified
'
,
async
()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
await
setValidFormData
();
...
...
@@ -285,8 +285,8 @@ describe('OnDemandScansForm', () => {
}),
);
mountShallowSubjec
t
();
await
subject
.
vm
.
$nextTick
();
createShallowComponen
t
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
findNameInput
().
attributes
(
'
value
'
)).
toBe
(
dastScan
.
name
);
expect
(
findDescriptionInput
().
attributes
(
'
value
'
)).
toBe
(
dastScan
.
description
);
...
...
@@ -299,7 +299,7 @@ describe('OnDemandScansForm', () => {
let
submitButton
;
beforeEach
(()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
submitButton
=
findSubmitButton
();
});
...
...
@@ -324,7 +324,7 @@ describe('OnDemandScansForm', () => {
({
actionFunction
,
submitButtonLoading
,
saveButtonLoading
,
runAfter
,
redirectPath
})
=>
{
describe
(
'
with valid form data
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
await
setupSuccess
();
actionFunction
();
});
...
...
@@ -344,7 +344,7 @@ describe('OnDemandScansForm', () => {
});
it
(
`triggers dastProfileCreateMutation mutation with runAfterCreate set to
${
runAfter
}
`
,
()
=>
{
expect
(
subject
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
mutation
:
dastProfileCreateMutation
,
variables
:
{
input
:
{
...
...
@@ -372,7 +372,7 @@ describe('OnDemandScansForm', () => {
describe
(
'
when editing an existing scan
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
propsData
:
{
dastScan
,
},
...
...
@@ -382,7 +382,7 @@ describe('OnDemandScansForm', () => {
});
it
(
`triggers dastProfileUpdateMutation mutation with runAfterUpdate set to
${
runAfter
}
`
,
async
()
=>
{
expect
(
subject
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
mutation
:
dastProfileUpdateMutation
,
variables
:
{
input
:
{
...
...
@@ -401,26 +401,26 @@ describe('OnDemandScansForm', () => {
});
it
(
'
does not run any mutation if name is empty
'
,
()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
setValidFormData
();
findNameInput
().
vm
.
$emit
(
'
input
'
,
''
);
actionFunction
();
expect
(
subject
.
vm
.
$apollo
.
mutate
).
not
.
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
$apollo
.
mutate
).
not
.
toHaveBeenCalled
();
});
},
);
describe
(
'
on top-level error
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
();
subject
.
vm
.
$apollo
.
mutate
.
mockRejectedValue
();
createShallowComponen
t
();
wrapper
.
vm
.
$apollo
.
mutate
.
mockRejectedValue
();
await
setValidFormData
();
submitForm
();
});
it
(
'
resets loading state
'
,
()
=>
{
expect
(
subject
.
vm
.
loading
).
toBe
(
false
);
expect
(
wrapper
.
vm
.
loading
).
toBe
(
false
);
});
it
(
'
shows an alert
'
,
()
=>
{
...
...
@@ -434,8 +434,8 @@ describe('OnDemandScansForm', () => {
const
errors
=
[
'
error#1
'
,
'
error#2
'
,
'
error#3
'
];
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
();
subject
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
createShallowComponen
t
();
wrapper
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
data
:
{
dastProfileCreate
:
{
pipelineUrl
:
null
,
errors
}
},
});
await
setValidFormData
();
...
...
@@ -443,7 +443,7 @@ describe('OnDemandScansForm', () => {
});
it
(
'
resets loading state
'
,
()
=>
{
expect
(
subject
.
vm
.
loading
).
toBe
(
false
);
expect
(
wrapper
.
vm
.
loading
).
toBe
(
false
);
});
it
(
'
shows an alert with the returned errors
'
,
()
=>
{
...
...
@@ -459,7 +459,7 @@ describe('OnDemandScansForm', () => {
describe
(
'
cancellation
'
,
()
=>
{
beforeEach
(()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
findCancelButton
().
vm
.
$emit
(
'
click
'
);
});
...
...
@@ -480,9 +480,9 @@ describe('OnDemandScansForm', () => {
'
profiles conflict prevention
'
,
({
description
,
selectedScannerProfile
,
selectedSiteProfile
,
hasConflict
})
=>
{
const
setFormData
=
()
=>
{
subject
.
find
(
ScannerProfileSelector
).
vm
.
$emit
(
'
input
'
,
selectedScannerProfile
.
id
);
subject
.
find
(
SiteProfileSelector
).
vm
.
$emit
(
'
input
'
,
selectedSiteProfile
.
id
);
return
subject
.
vm
.
$nextTick
();
wrapper
.
find
(
ScannerProfileSelector
).
vm
.
$emit
(
'
input
'
,
selectedScannerProfile
.
id
);
wrapper
.
find
(
SiteProfileSelector
).
vm
.
$emit
(
'
input
'
,
selectedSiteProfile
.
id
);
return
wrapper
.
vm
.
$nextTick
();
};
it
(
...
...
@@ -490,7 +490,7 @@ describe('OnDemandScansForm', () => {
?
`warns about conflicting profiles when user selects
${
description
}
`
:
`does not report any conflict when user selects
${
description
}
`
,
async
()
=>
{
mountShallowSubjec
t
();
createShallowComponen
t
();
await
setFormData
();
expect
(
findProfilesConflictAlert
().
exists
()).
toBe
(
hasConflict
);
...
...
@@ -508,7 +508,7 @@ describe('OnDemandScansForm', () => {
const
[
profile
]
=
profiles
;
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
(
createShallowComponen
t
(
{},
{
[
query
]:
jest
.
fn
().
mockResolvedValue
(
responses
[
query
]([
profile
])),
...
...
@@ -519,13 +519,13 @@ describe('OnDemandScansForm', () => {
});
it
(
'
automatically selects the only available profile
'
,
()
=>
{
expect
(
subject
.
find
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
expect
(
wrapper
.
find
(
selector
).
attributes
(
'
value
'
)).
toBe
(
profile
.
id
);
});
});
describe
(
'
scanner profile summary
'
,
()
=>
{
beforeEach
(()
=>
{
mountSubjec
t
({
createComponen
t
({
provide
:
{
glFeatures
:
{
securityDastSiteProfilesAdditionalFields
:
true
,
...
...
@@ -545,7 +545,7 @@ describe('OnDemandScansForm', () => {
const
[
authEnabledProfile
]
=
siteProfiles
;
beforeEach
(()
=>
{
mountSubjec
t
({
createComponen
t
({
provide
:
{
glFeatures
:
{
securityDastSiteProfilesAdditionalFields
:
true
,
...
...
@@ -556,7 +556,7 @@ describe('OnDemandScansForm', () => {
it
(
'
renders all fields correctly
'
,
async
()
=>
{
await
selectSiteProfile
(
authEnabledProfile
);
const
summary
=
subject
.
find
(
SiteProfileSelector
).
text
();
const
summary
=
wrapper
.
find
(
SiteProfileSelector
).
text
();
const
defaultPassword
=
'
••••••••
'
;
const
defaultRequestHeaders
=
'
[Redacted]
'
;
...
...
@@ -585,28 +585,28 @@ describe('OnDemandScansForm', () => {
global
.
jsdom
.
reconfigure
({
url
:
setUrlParams
({
scanner_profile_id
:
1
},
URL_HOST
),
});
mountShallowSubjec
t
();
createShallowComponen
t
();
expect
(
subject
.
find
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
expect
(
wrapper
.
find
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
});
it
(
'
site profile
'
,
()
=>
{
global
.
jsdom
.
reconfigure
({
url
:
setUrlParams
({
site_profile_id
:
1
},
URL_HOST
),
});
mountShallowSubjec
t
();
createShallowComponen
t
();
expect
(
subject
.
find
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
expect
(
wrapper
.
find
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
});
it
(
'
both scanner & site profile
'
,
()
=>
{
global
.
jsdom
.
reconfigure
({
url
:
setUrlParams
({
site_profile_id
:
1
,
scanner_profile_id
:
1
},
URL_HOST
),
});
mountShallowSubjec
t
();
createShallowComponen
t
();
expect
(
subject
.
find
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
expect
(
subject
.
find
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
expect
(
wrapper
.
find
(
SiteProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
expect
(
wrapper
.
find
(
ScannerProfileSelector
).
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
});
it
(
'
when local storage data is available
'
,
async
()
=>
{
...
...
@@ -622,8 +622,8 @@ describe('OnDemandScansForm', () => {
url
:
setUrlParams
({
site_profile_id
:
1
,
scanner_profile_id
:
1
},
URL_HOST
),
});
mountShallowSubjec
t
();
await
subject
.
vm
.
$nextTick
();
createShallowComponen
t
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
findScannerProfilesSelector
().
attributes
(
'
value
'
)).
toBe
(
scannerProfile
.
id
);
expect
(
findSiteProfilesSelector
().
attributes
(
'
value
'
)).
toBe
(
siteProfile
.
id
);
...
...
@@ -632,7 +632,7 @@ describe('OnDemandScansForm', () => {
describe
(
'
when no repository exists
'
,
()
=>
{
beforeEach
(()
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
propsData
:
{
/**
* The assumption here is that, if a default branch is not defined, then the project
...
...
@@ -644,7 +644,7 @@ describe('OnDemandScansForm', () => {
});
it
(
'
shows an error message
'
,
()
=>
{
expect
(
subject
.
text
()).
toContain
(
expect
(
wrapper
.
text
()).
toContain
(
'
You must create a repository within your project to run an on-demand scan.
'
,
);
});
...
...
@@ -658,14 +658,14 @@ describe('OnDemandScansForm', () => {
`
(
'
on $action
'
,
({
actionFunction
,
runAfter
})
=>
{
describe
(
'
when creating a new scan
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
provide
:
{
glFeatures
:
{
dastBranchSelection
:
false
,
},
},
});
subject
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
wrapper
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
data
:
{
dastProfileCreate
:
{
dastProfile
:
{
editPath
},
...
...
@@ -677,12 +677,12 @@ describe('OnDemandScansForm', () => {
findNameInput
().
vm
.
$emit
(
'
input
'
,
'
My daily scan
'
);
findScannerProfilesSelector
().
vm
.
$emit
(
'
input
'
,
passiveScannerProfile
.
id
);
findSiteProfilesSelector
().
vm
.
$emit
(
'
input
'
,
nonValidatedSiteProfile
.
id
);
await
subject
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
actionFunction
();
});
it
(
`triggers dastProfileCreateMutation mutation without the branch name and runAfterCreate set to
${
runAfter
}
`
,
async
()
=>
{
expect
(
subject
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
mutation
:
dastProfileCreateMutation
,
variables
:
{
input
:
{
...
...
@@ -699,7 +699,7 @@ describe('OnDemandScansForm', () => {
describe
(
'
when editing an existing scan
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mountShallowSubjec
t
({
createShallowComponen
t
({
propsData
:
{
dastScan
,
},
...
...
@@ -709,7 +709,7 @@ describe('OnDemandScansForm', () => {
},
},
});
subject
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
wrapper
.
vm
.
$apollo
.
mutate
.
mockResolvedValue
({
data
:
{
dastProfileUpdate
:
{
dastProfile
:
{
editPath
},
...
...
@@ -721,12 +721,12 @@ describe('OnDemandScansForm', () => {
findNameInput
().
vm
.
$emit
(
'
input
'
,
'
My daily scan
'
);
findScannerProfilesSelector
().
vm
.
$emit
(
'
input
'
,
passiveScannerProfile
.
id
);
findSiteProfilesSelector
().
vm
.
$emit
(
'
input
'
,
nonValidatedSiteProfile
.
id
);
await
subject
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
actionFunction
();
});
it
(
`triggers dastProfileUpdateMutation mutation without the branch name and runAfterUpdate set to
${
runAfter
}
`
,
async
()
=>
{
expect
(
subject
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
expect
(
wrapper
.
vm
.
$apollo
.
mutate
).
toHaveBeenCalledWith
({
mutation
:
dastProfileUpdateMutation
,
variables
:
{
input
:
{
...
...
qa/qa/page/project/fork/new.rb
View file @
c1de6bd0
...
...
@@ -13,8 +13,18 @@ module QA
element
:fork_groups_list_search_field
end
def
choose_namespace
(
namespace
=
Runtime
::
Namespace
.
path
)
click_element
(
:fork_namespace_button
,
name:
namespace
)
view
'app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue'
do
element
:fork_namespace_dropdown
element
:fork_project_button
end
def
fork_project
(
namespace
=
Runtime
::
Namespace
.
path
)
if
has_element?
(
:fork_namespace_button
,
wait:
0
)
click_element
(
:fork_namespace_button
,
name:
namespace
)
else
select_element
(
:fork_namespace_dropdown
,
namespace
)
click_element
(
:fork_project_button
)
end
end
def
search_for_group
(
group_name
)
...
...
qa/qa/resource/fork.rb
View file @
c1de6bd0
...
...
@@ -3,6 +3,8 @@
module
QA
module
Resource
class
Fork
<
Base
attr_accessor
:namespace_path
attribute
:name
do
upstream
.
name
end
...
...
@@ -31,6 +33,8 @@ module QA
def
fabricate!
populate
(
:upstream
,
:user
)
namespace_path
||=
user
.
name
# Sign out as admin and sign is as the fork user
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
...
...
@@ -43,11 +47,11 @@ module QA
Page
::
Project
::
Show
.
perform
(
&
:fork_project
)
Page
::
Project
::
Fork
::
New
.
perform
do
|
fork_new
|
fork_new
.
choose_namespace
(
user
.
name
)
fork_new
.
fork_project
(
namespace_path
)
end
Page
::
Layout
::
Banner
.
perform
do
|
banner
|
banner
.
has_notice?
(
'The project was successfully forked.'
)
Page
::
Project
::
Show
.
perform
do
|
project_page
|
raise
ResourceFabricationFailedError
,
"Forking failed!"
unless
project_page
.
forked_from?
(
upstream
.
name
)
end
populate
(
:project
)
...
...
qa/qa/specs/features/browser_ui/3_create/merge_request/merge_merge_request_from_fork_spec.rb
View file @
c1de6bd0
...
...
@@ -2,14 +2,12 @@
module
QA
RSpec
.
describe
'Create'
do
describe
'Merge request creation from fork'
do
let!
(
:merge_request
)
do
Resource
::
MergeRequestFromFork
.
fabricate_via_browser_ui!
do
|
merge_request
|
describe
'Merge request creation from fork'
,
:smoke
do
it
'can merge feature branch fork to mainline'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701'
do
merge_request
=
Resource
::
MergeRequestFromFork
.
fabricate_via_browser_ui!
do
|
merge_request
|
merge_request
.
fork_branch
=
'feature-branch'
end
end
it
'can merge feature branch fork to mainline'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1701'
do
Flow
::
Login
.
while_signed_in
do
merge_request
.
visit!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment