From aaf124b0f7698f5def277b02ab97f3992fe1569d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 18 Nov 2019 21:06:19 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- qa/spec/page/element_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'qa/spec') diff --git a/qa/spec/page/element_spec.rb b/qa/spec/page/element_spec.rb index ff5e118cefa..3f64743ffac 100644 --- a/qa/spec/page/element_spec.rb +++ b/qa/spec/page/element_spec.rb @@ -117,5 +117,23 @@ describe QA::Page::Element do it 'properly translates to a data-qa-selector' do expect(subject.selector_css).to include(%q([data-qa-selector="my_element"])) end + + context 'additional selectors' do + let(:element) { described_class.new(:my_element, index: 3, another_match: 'something') } + let(:required_element) { described_class.new(:my_element, required: true, index: 3) } + + it 'matches on additional data-qa properties' do + expect(element.selector_css).to include(%q([data-qa-selector="my_element"][data-qa-index="3"])) + end + + it 'doesnt conflict with element requirement' do + expect(required_element).to be_required + expect(required_element.selector_css).not_to include(%q(data-qa-required)) + end + + it 'translates snake_case to kebab-case' do + expect(element.selector_css).to include(%q(data-qa-another-match)) + end + end end end -- cgit v1.2.1