/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */
import { percySnapshot } from '@percy/puppeteer';

/**
 * WordPress dependencies
 */
import { visitAdminPage } from '@wordpress/e2e-test-utils';

describe('Get Started Story', () => {
  it('should prefill post title and post content', async () => {
    await visitAdminPage(
      'post-new.php',
      'post_type=web-story&web-stories-demo=1'
    );
    await expect(page).toMatch('Tips to make the most of Web Stories');

    await percySnapshot(page, 'Get Started Story');
  });
});

@@ -715,16 +715,52 @@
 import %7B
+%0A  loginUser,%0A  switchUserToAdmin,%0A 
  visitAd
@@ -766,17 +766,18 @@
 dminPage
- 
+,%0A
 %7D from '
@@ -843,16 +843,51 @@
 () =%3E %7B%0A
+  describe('Admin User', () =%3E %7B%0A  
   it('sh
@@ -943,24 +943,26 @@
 () =%3E %7B%0A    
+  
 await visitA
@@ -971,16 +971,18 @@
 inPage(%0A
+  
       'p
@@ -997,24 +997,26 @@
 php',%0A      
+  
 'post_type=w
@@ -1052,15 +1052,19 @@
     
+  
 );%0A    
+ 
+ 
 awai
@@ -1128,24 +1128,26 @@
 ies');%0A%0A    
+  
 await percyS
@@ -1178,17 +1178,548 @@
 ed Story
-'
+ (Admin)');%0A    %7D);%0A  %7D);%0A%0A  describe('Author User', () =%3E %7B%0A    beforeAll(async () =%3E %7B%0A      await loginUser('author', 'password');%0A    %7D);%0A%0A    afterAll(async () =%3E %7B%0A      await switchUserToAdmin();%0A    %7D);%0A%0A    it('should prefill post title and post content', async () =%3E %7B%0A      await visitAdminPage(%0A        'post-new.php',%0A        'post_type=web-story&web-stories-demo=1'%0A      );%0A      await expect(page).toMatch('Tips to make the most of Web Stories');%0A%0A      await percySnapshot(page, 'Get Started Story (Author)');%0A    %7D
 );%0A  %7D);

Add e2e test for author user role