Function When_I_set_viewport

  • When I set viewport to preset:

    When I set viewport to {string}
    

    When I set viewport to preset and orientation:

    When I set viewport to {string} and {string}
    

    Preset supports the following options:

    Preset width height
    ipad-2 768 1024
    ipad-mini 768 1024
    iphone-3 320 480
    iphone-4 320 480
    iphone-5 320 568
    iphone-6 375 667
    iphone-6+ 414 736
    iphone-7 375 667
    iphone-8 375 667
    iphone-x 375 812
    iphone-xr 414 896
    iphone-se2 375 667
    macbook-11 1366 768
    macbook-13 1280 800
    macbook-15 1440 900
    macbook-16 1536 960
    samsung-note9 414 846
    samsung-s10 360 760

    The default orientation is portrait.

    Parameters

    • preset:
          | "macbook-16"
          | "macbook-15"
          | "macbook-13"
          | "macbook-11"
          | "ipad-2"
          | "ipad-mini"
          | "iphone-xr"
          | "iphone-x"
          | "iphone-6+"
          | "iphone-se2"
          | "iphone-8"
          | "iphone-7"
          | "iphone-6"
          | "iphone-5"
          | "iphone-4"
          | "iphone-3"
          | "samsung-s10"
          | "samsung-note9"
    • orientation: "portrait" | "landscape" = 'portrait'

    Returns void

    Resize viewport to iPhone 6 width and height (375px x 667px):

    When I set viewport to "iphone-6"
    

    Resize viewport to iPhone 6 width and height and change orientation to landscape:

    When I set viewport to "iphone-6" and "landscape"
    

    Controls the size and orientation of the screen for your application.