Skip to content
Snippets Groups Projects
Commit 10d0e569 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent a19a376b
No related branches found
No related tags found
No related merge requests found
Showing
with 58 additions and 55 deletions
Loading
Loading
@@ -23,8 +23,7 @@ module QA
end
 
it 'user imports a GitHub repo' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
imported_project # import the project
 
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Manage' do
describe 'Project activity' do
it 'user creates an event in the activity page upon Git push' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
project_push = Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md'
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Create a new merge request' do
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
@project = Resource::Project.fabricate_via_api! do |project|
project.name = 'project'
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Merge request creation from fork' do
it 'user forks a project, submits a merge request and maintainer merges it' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
merge_request = Resource::MergeRequestFromFork.fabricate! do |merge_request|
merge_request.fork_branch = 'feature-branch'
Loading
Loading
Loading
Loading
@@ -5,8 +5,7 @@ module QA
context 'Create', :quarantine do
describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
project = Resource::Project.fabricate! do |project|
project.name = "only-fast-forward"
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Merge request squashing' do
it 'user squashes commits while merging' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
project = Resource::Project.fabricate! do |project|
project.name = "squash-before-merge"
Loading
Loading
Loading
Loading
@@ -16,8 +16,7 @@ module QA
commit_message_of_third_branch = "Add #{file_third_branch}"
 
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
project = Resource::Project.fabricate! do |proj|
proj.name = 'project-qa-test'
Loading
Loading
Loading
Loading
@@ -6,8 +6,7 @@ module QA
let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
 
it 'user adds and then removes an SSH key', :smoke do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
key = Resource::SSHKey.fabricate! do |resource|
resource.title = key_title
Loading
Loading
Loading
Loading
@@ -6,8 +6,7 @@ module QA
context 'Create', :quarantine do
describe 'Push over HTTP using Git protocol version 2', :requires_git_protocol_v2 do
it 'user pushes to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
# Create a project to push to
project = Resource::Project.fabricate! do |project|
Loading
Loading
Loading
Loading
@@ -17,20 +17,15 @@ module QA
end
end
 
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
around do |example|
# Create an SSH key to be used with Git
login
Flow::Login.sign_in
ssh_key
 
example.run
 
# Remove the SSH key
login
Flow::Login.sign_in
Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys|
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do
it 'user using a personal access token pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
access_token = Resource::PersonalAccessToken.fabricate!.access_token
 
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do
it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
project_push = Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md'
Loading
Loading
Loading
Loading
@@ -9,8 +9,7 @@ module QA
let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
 
it 'user adds an ssh key and pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
key = Resource::SSHKey.fabricate! do |resource|
resource.title = key_title
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create', :smoke do
describe 'Snippet creation' do
it 'User creates a snippet' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
Page::Main::Menu.perform(&:go_to_snippets)
 
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Create' do
describe 'Wiki management' do
it 'user creates, edits, clones, and pushes to the wiki' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
wiki = Resource::Wiki.fabricate! do |resource|
resource.title = 'Home'
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Release' do
describe 'Deploy key creation' do
it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
key = Runtime::Key::RSA.new
deploy_key_title = 'deploy key title'
Loading
Loading
Loading
Loading
@@ -10,8 +10,7 @@ module QA
@job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json')
Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled
 
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
@runner_name = "qa-runner-#{Time.now.to_i}"
 
Loading
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module QA
context 'Release' do
describe 'Deploy token creation' do
it 'user adds a deploy token' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
Flow::Login.sign_in
 
deploy_token_name = 'deploy token name'
one_week_from_now = Date.today + 7
Loading
Loading
import { useLocalStorageSpy } from 'helpers/local_storage_helper';
import AccessorUtilities from '~/lib/utils/accessor';
 
describe('AccessorUtilities', () => {
useLocalStorageSpy();
const testError = new Error('test error');
 
describe('isPropertyAccessSafe', () => {
let base;
 
it('should return `true` if access is safe', () => {
base = { testProp: 'testProp' };
base = {
testProp: 'testProp',
};
expect(AccessorUtilities.isPropertyAccessSafe(base, 'testProp')).toBe(true);
});
 
Loading
Loading
@@ -54,17 +58,12 @@ describe('AccessorUtilities', () => {
});
 
describe('isLocalStorageAccessSafe', () => {
beforeEach(() => {
spyOn(window.localStorage, 'setItem');
spyOn(window.localStorage, 'removeItem');
});
it('should return `true` if access is safe', () => {
expect(AccessorUtilities.isLocalStorageAccessSafe()).toBe(true);
});
 
it('should return `false` if access to .setItem isnt safe', () => {
window.localStorage.setItem.and.callFake(() => {
window.localStorage.setItem.mockImplementation(() => {
throw testError;
});
 
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ describe('DOM Utils', () => {
 
addClassIfElementExists(childElement, className);
 
expect(childElement.classList).toContain(className);
expect(childElement.classList).toContainEqual(className);
});
 
it('does not throw if element does not exist', () => {
Loading
Loading
@@ -40,22 +40,44 @@ describe('DOM Utils', () => {
describe('canScrollUp', () => {
[1, 100].forEach(scrollTop => {
it(`is true if scrollTop is > 0 (${scrollTop})`, () => {
expect(canScrollUp({ scrollTop })).toBe(true);
expect(
canScrollUp({
scrollTop,
}),
).toBe(true);
});
});
 
[0, -10].forEach(scrollTop => {
it(`is false if scrollTop is <= 0 (${scrollTop})`, () => {
expect(canScrollUp({ scrollTop })).toBe(false);
expect(
canScrollUp({
scrollTop,
}),
).toBe(false);
});
});
 
it('is true if scrollTop is > margin', () => {
expect(canScrollUp({ scrollTop: TEST_MARGIN + 1 }, TEST_MARGIN)).toBe(true);
expect(
canScrollUp(
{
scrollTop: TEST_MARGIN + 1,
},
TEST_MARGIN,
),
).toBe(true);
});
 
it('is false if scrollTop is <= margin', () => {
expect(canScrollUp({ scrollTop: TEST_MARGIN }, TEST_MARGIN)).toBe(false);
expect(
canScrollUp(
{
scrollTop: TEST_MARGIN,
},
TEST_MARGIN,
),
).toBe(false);
});
});
 
Loading
Loading
@@ -63,7 +85,11 @@ describe('DOM Utils', () => {
let element;
 
beforeEach(() => {
element = { scrollTop: 7, offsetHeight: 22, scrollHeight: 30 };
element = {
scrollTop: 7,
offsetHeight: 22,
scrollHeight: 30,
};
});
 
it('is true if element can be scrolled down', () => {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment