playwright-ruby-client 1.29.1 → 1.30.beta1

Sign up to get free protection for your applications and to get access to all the features.
@@ -596,40 +596,93 @@ module Playwright
596
596
  end
597
597
 
598
598
  #
599
- # Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
599
+ # Allows locating elements by their alt text.
600
+ #
601
+ # **Usage**
602
+ #
603
+ # For example, this method will find the image by alt text "Playwright logo":
600
604
  #
601
605
  # ```html
602
- # <img alt='Castle'>
606
+ # <img alt='Playwright logo'>
607
+ # ```
608
+ #
609
+ # ```python sync
610
+ # page.get_by_alt_text("Playwright logo").click()
603
611
  # ```
604
612
  def get_by_alt_text(text, exact: nil)
605
613
  wrap_impl(@impl.get_by_alt_text(unwrap_impl(text), exact: unwrap_impl(exact)))
606
614
  end
607
615
 
608
616
  #
609
- # Allows locating input elements by the text of the associated label. For example, this method will find the input by label text "Password" in the following DOM:
617
+ # Allows locating input elements by the text of the associated label.
618
+ #
619
+ # **Usage**
620
+ #
621
+ # For example, this method will find the input by label text "Password" in the following DOM:
610
622
  #
611
623
  # ```html
612
624
  # <label for="password-input">Password:</label>
613
625
  # <input id="password-input">
614
626
  # ```
627
+ #
628
+ # ```python sync
629
+ # page.get_by_label("Password").fill("secret")
630
+ # ```
615
631
  def get_by_label(text, exact: nil)
616
632
  wrap_impl(@impl.get_by_label(unwrap_impl(text), exact: unwrap_impl(exact)))
617
633
  end
618
634
 
619
635
  #
620
- # Allows locating input elements by the placeholder text. For example, this method will find the input by placeholder "Country":
636
+ # Allows locating input elements by the placeholder text.
637
+ #
638
+ # **Usage**
639
+ #
640
+ # For example, consider the following DOM structure.
621
641
  #
622
642
  # ```html
623
- # <input placeholder="Country">
643
+ # <input type="email" placeholder="name@example.com" />
644
+ # ```
645
+ #
646
+ # You can fill the input after locating it by the placeholder text:
647
+ #
648
+ # ```python sync
649
+ # page.get_by_placeholder("name@example.com").fill("playwright@microsoft.com")
624
650
  # ```
625
651
  def get_by_placeholder(text, exact: nil)
626
652
  wrap_impl(@impl.get_by_placeholder(unwrap_impl(text), exact: unwrap_impl(exact)))
627
653
  end
628
654
 
629
655
  #
630
- # Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). Note that role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
656
+ # Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles), [ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
657
+ #
658
+ # **Usage**
659
+ #
660
+ # Consider the following DOM structure.
661
+ #
662
+ # ```html
663
+ # <h3>Sign up</h3>
664
+ # <label>
665
+ # <input type="checkbox" /> Subscribe
666
+ # </label>
667
+ # <br/>
668
+ # <button>Submit</button>
669
+ # ```
670
+ #
671
+ # You can locate each element by it's implicit role:
672
+ #
673
+ # ```python sync
674
+ # expect(page.get_by_role("heading", name="Sign up")).to_be_visible()
675
+ #
676
+ # page.get_by_role("checkbox", name="Subscribe").check()
631
677
  #
632
- # Note that many html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
678
+ # page.get_by_role("button", name=re.compile("submit", re.IGNORECASE)).click()
679
+ # ```
680
+ #
681
+ # **Details**
682
+ #
683
+ # Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
684
+ #
685
+ # Many html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
633
686
  def get_by_role(
634
687
  role,
635
688
  checked: nil,
@@ -645,13 +698,37 @@ module Playwright
645
698
  end
646
699
 
647
700
  #
648
- # Locate element by the test id. By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.
701
+ # Locate element by the test id.
702
+ #
703
+ # **Usage**
704
+ #
705
+ # Consider the following DOM structure.
706
+ #
707
+ # ```html
708
+ # <button data-testid="directions">Itinéraire</button>
709
+ # ```
710
+ #
711
+ # You can locate the element by it's test id:
712
+ #
713
+ # ```python sync
714
+ # page.get_by_test_id("directions").click()
715
+ # ```
716
+ #
717
+ # **Details**
718
+ #
719
+ # By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary.
649
720
  def get_by_test_id(testId)
650
721
  wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
651
722
  end
652
723
 
653
724
  #
654
- # Allows locating elements that contain given text. Consider the following DOM structure:
725
+ # Allows locating elements that contain given text.
726
+ #
727
+ # See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content.
728
+ #
729
+ # **Usage**
730
+ #
731
+ # Consider the following DOM structure:
655
732
  #
656
733
  # ```html
657
734
  # <div>Hello <span>world</span></div>
@@ -677,20 +754,30 @@ module Playwright
677
754
  # page.get_by_text(re.compile("^hello$", re.IGNORECASE))
678
755
  # ```
679
756
  #
680
- # See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content.
757
+ # **Details**
681
758
  #
682
- # **NOTE**: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.
759
+ # Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.
683
760
  #
684
- # **NOTE**: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
761
+ # Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
685
762
  def get_by_text(text, exact: nil)
686
763
  wrap_impl(@impl.get_by_text(unwrap_impl(text), exact: unwrap_impl(exact)))
687
764
  end
688
765
 
689
766
  #
690
- # Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
767
+ # Allows locating elements by their title attribute.
768
+ #
769
+ # **Usage**
770
+ #
771
+ # Consider the following DOM structure.
691
772
  #
692
773
  # ```html
693
- # <button title='Place the order'>Order Now</button>
774
+ # <span title='Issues count'>25 issues</span>
775
+ # ```
776
+ #
777
+ # You can check the issues count after locating it by the title text:
778
+ #
779
+ # ```python sync
780
+ # expect(page.get_by_title("Issues count")).to_have_text("25 issues")
694
781
  # ```
695
782
  def get_by_title(text, exact: nil)
696
783
  wrap_impl(@impl.get_by_title(unwrap_impl(text), exact: unwrap_impl(exact)))
@@ -99,7 +99,7 @@ module Playwright
99
99
  #
100
100
  # ```python sync
101
101
  # def handle(route):
102
- # response = route.fulfill()
102
+ # response = route.fetch()
103
103
  # json = response.json()
104
104
  # json["message"]["big_red_dog"] = []
105
105
  # route.fulfill(response=response, json=json)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.1
4
+ version: 1.30.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-15 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -394,12 +394,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
394
394
  version: '2.4'
395
395
  required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  requirements:
397
- - - ">="
397
+ - - ">"
398
398
  - !ruby/object:Gem::Version
399
- version: '0'
399
+ version: 1.3.1
400
400
  requirements: []
401
401
  rubygems_version: 3.3.26
402
402
  signing_key:
403
403
  specification_version: 4
404
- summary: The Ruby binding of playwright driver 1.29.2
404
+ summary: The Ruby binding of playwright driver 1.30.0
405
405
  test_files: []