-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathgutenberg-editor-gallery.test.js
51 lines (42 loc) · 1.25 KB
/
gutenberg-editor-gallery.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Internal dependencies
*/
import EditorPage from './pages/editor-page';
import { setupDriver, isLocalEnvironment, stopDriver } from './helpers/utils';
jest.setTimeout( 1000000 );
describe( 'Gutenberg Editor Gallery Block tests', () => {
let driver;
let editorPage;
let allPassed = true;
const galleryBlockName = 'Gallery';
// Use reporter for setting status for saucelabs Job
if ( ! isLocalEnvironment() ) {
const reporter = {
specDone: async ( result ) => {
allPassed = allPassed && result.status !== 'failed';
},
};
jasmine.getEnv().addReporter( reporter );
}
beforeAll( async () => {
driver = await setupDriver();
editorPage = new EditorPage( driver );
} );
it( 'should be able to see visual editor', async () => {
await expect( editorPage.getBlockList() ).resolves.toBe( true );
} );
it( 'should be able to add a gallery block', async () => {
await editorPage.addNewBlock( galleryBlockName );
const galleryBlock = await editorPage.getBlockAtPosition(
galleryBlockName
);
expect( galleryBlock ).toBeTruthy();
await editorPage.removeBlockAtPosition( galleryBlockName );
} );
afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
}
await stopDriver( driver );
} );
} );