diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 21:06:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 21:06:19 +0000 |
commit | aaf124b0f7698f5def277b02ab97f3992fe1569d (patch) | |
tree | e5ed2e5430b4eb67ea4a0e0348979d7967ce050d /qa/spec | |
parent | 143f196f8b3c40ceb7e9335a8dcc712b079519b9 (diff) | |
download | gitlab-ce-aaf124b0f7698f5def277b02ab97f3992fe1569d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/page/element_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
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 |