<commit_before>#Namespace Test Case 9: NEG - Namespace edit textfield validation

require './spec/setup_browser'
require './lib/component_modules_spec'
require './lib/dtk_common'
require './lib/admin_panel_helper'

num='9'
group=UserGroup.new('demo_group'+num, 'Demo Group.'+num)

user=User.new('demo_user1'+num,'password','<PASSWORD>','User','demo_user1'+num+   '@mail.com','3','demo_group'+num)
ns_max_user=User.new('demo_user2'+num,'password','<PASSWORD>','User','demo_user2'+num+'@mail.<EMAIL>','1','demo_group'+num)

first_ns=Namespace.new('demo_ns1'+num,'demo_user1'+num,'demo_group'+num,'RW','RW','RW')
second_ns=Namespace.new('demo_ns2'+num,'demo_user1'+num,'demo_group'+num,'RW','RW','RW')

invalid_owner_ns=Namespace.new('demo_ns1'+num,'demo_user2'+num,'demo_group'+num,'RW','RW','RW')

empty_ns=Namespace.new('','','','','','')
invalid_ns=Namespace.new('!@#$%'+num,'demo_user1'+num,'demo_group'+num,'','','')


describe "(Admin Panel UI) Test Case 9: NEG - Namespace edit textfield validation" do
	let(:conf) { Configuration.instance }
  	let(:header) { @homepage.get_header }
  	let(:group_panel) { @homepage.get_main.get_usergroups }
  	let(:user_panel) { @homepage.get_main.get_users}
  	let(:ns_panel) { @homepage.get_main.get_namespaces }

  	context "User is" do
		it "logged in" do
      		@homepage.get_loginpage.login_user(conf.username, conf.password)
	    	homepage_header = header.get_homepage_header
	    	expect(homepage_header).to have_content('DTK')
    	end
  	end

  	context "Create Usergroup #{group.name}" do
        it "created usergroup" do
            group.create_object(group_panel)
        end
    end

    context "Open Users panel" do
    	it "opened panel" do
    		header.click_on_users
    	end
    end

    context "Create User #{user.username}" do
    	it "created user" do
    		user.create_object(user_panel)
    	end
    end

    context "Create User #{ns_max_user.username}" do
    	it "created uesr" do
    		ns_max_user.create_object(user_panel)
    	end
    end

    context "Open Namespace panel" do
    	it "opened panel" do
    		header.click_on_namespaces
    	end
    end

    context "Create Namespace #{first_ns.name}" do
    	it "created namespace" do
    		first_ns.create_object(ns_panel)
    	end
    end

    context "Create Namespace #{second_ns.name}" do
    	it "created namespace" do
    		second_ns.create_object(ns_panel)
    	end
    end

    context "Open Edit page for Namespace #{first_ns.name}" do
    	it "opened edit page" do
    	 	ns_panel.search_for_object(first_ns.name)
    	 	ns_panel.open_edit_page(first_ns.name)
    	end
    end

    context "Deselect user, group and permissions" do
    	it "deselected properties" do
    		ns_panel.deselect_properties(first_ns.group)
    	end
    end

    context "Edit page with unselected user, group and permission" do<commit_msg>fixed repoman admin panel ui test 09<commit_after>#Namespace Test Case 9: NEG - Namespace edit textfield validation

require './spec/setup_browser'
require './lib/component_modules_spec'
require './lib/dtk_common'
require './lib/admin_panel_helper'

num='9'
group=UserGroup.new('demo_group'+num, 'Demo Group.'+num)

user=User.new('demo_user1'+num,'password','<PASSWORD>','User','demo_user1'+num+   '@mail.com','3','demo_group'+num)
ns_max_user=User.new('demo_user2'+num,'password','<PASSWORD>','User','<EMAIL>2'+num+'<EMAIL>','1','demo_group'+num)

first_ns=Namespace.new('demo_ns1'+num,'demo_user1'+num,'demo_group'+num,'RW','RW','RW')
second_ns=Namespace.new('demo_ns2'+num,'demo_user2'+num,'demo_group'+num,'RW','RW','RW')

invalid_owner_ns=Namespace.new('demo_ns1'+num,'demo_user2'+num,'demo_group'+num,'RW','RW','RW')

empty_ns=Namespace.new('','','','','','')
invalid_ns=Namespace.new('!@#$%'+num,'demo_user1'+num,'demo_group'+num,'','','')


describe "(Admin Panel UI) Test Case 9: NEG - Namespace edit textfield validation" do
	let(:conf) { Configuration.instance }
  	let(:header) { @homepage.get_header }
  	let(:group_panel) { @homepage.get_main.get_usergroups }
  	let(:user_panel) { @homepage.get_main.get_users}
  	let(:ns_panel) { @homepage.get_main.get_namespaces }

  	context "User is" do
		it "logged in" do
      		@homepage.get_loginpage.login_user(conf.username, conf.password)
	    	homepage_header = header.get_homepage_header
	    	expect(homepage_header).to have_content('DTK')
    	end
  	end

  	context "Create Usergroup #{group.name}" do
        it "created usergroup" do
            group.create_object(group_panel)
        end
    end

    context "Open Users panel" do
    	it "opened panel" do
    		header.click_on_users
    	end
    end

    context "Create User #{user.username}" do
    	it "created user" do
    		user.create_object(user_panel)
    	end
    end

    context "Create User #{ns_max_user.username}" do
    	it "created uesr" do
    		ns_max_user.create_object(user_panel)
    	end
    end

    context "Open Namespace panel" do
    	it "opened panel" do
    		header.click_on_namespaces
    	end
    end

    context "Create Namespace #{first_ns.name}" do
    	it "created namespace" do
    		first_ns.create_object(ns_panel)
    	end
    end

    context "Create Namespace #{second_ns.name}" do
    	it "created namespace" do
    		second_ns.create_object(ns_panel)
            expect(ns_panel.on_create_page?).to eql(false) 
    	end
    end

    context "Open Edit page for Namespace #{first_ns.name}" do
    	it "opened edit page" do
    	 	ns_panel.search_for_object(first_ns.name)
    	 	ns_panel.open_edit_page(first_ns.name)
    	end
    end

    context "Deselect user, group and permissions" do
    	it "deselected properties" do
    		ns_panel.deselect_properties(first_ns.group)
    	end
    end

    context "Edit page with unselected user, group and permission" do
{'fraction_non_alphanumeric': 0.13604148660328436, 'fraction_numerical': 0.005877268798617113, 'mean_word_length': 3.9922346850733392, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1796180', 'n_tokens_mistral': 2061, 'n_tokens_neox': 2016, 'n_words': 393}