Skip to content

Commit 28a3963

Browse files
authored
Merge pull request #353 from smalruby/fix-local-test-integration-on-docker
test: fix for local on macOS
2 parents eb40e67 + fd3a178 commit 28a3963

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

test/helpers/selenium-helper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ class SeleniumHelper {
133133
const chromeCapabilities = webdriver.Capabilities.chrome();
134134
const args = [];
135135
if (USE_HEADLESS) {
136-
args.push('--headless');
136+
args.push('--headless=new');
137137
}
138138

139139
if (IS_ROOT_USER) {
140140
args.push('--no-sandbox');
141141
args.push('--disable-setuid-sandbox');
142142
}
143143

144-
args.push('--disable-gpu');
145144
args.push('--disable-dev-shm-usage');
146145
args.push('--disable-extensions');
147146

test/integration/menu-bar.test.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ describe('Menu bar settings', () => {
5050

5151
test('Logo should be clickable', async () => {
5252
await loadUri(uri);
53+
54+
// 外部サイトへアクセスするためCIではスキップする
55+
if (process.env.CI) {
56+
await findByXpath('//img[@alt="Smalruby"]');
57+
return;
58+
}
59+
5360
await clickXpath('//img[@alt="Smalruby"]');
5461
const currentUrl = await driver.getCurrentUrl();
5562
await expect(currentUrl).toEqual('https://smalruby.jp/');
@@ -70,23 +77,24 @@ describe('Menu bar settings', () => {
7077
const input = await findByXpath('//input[@accept=".sb,.sb2,.sb3"]');
7178
await input.sendKeys(path.resolve(__dirname, '../fixtures/project1.sb3'));
7279
// No replace alert since no changes were made
73-
await findByText('project1-sprite');
80+
await findByText('project1-sprite', scope.spriteTile);
7481
});
7582

7683
test('User is warned before uploading project file over an edited project', async () => {
7784
await loadUri(uri);
7885

7986
// Change the project by deleting a sprite
8087
await rightClickText('Sprite1', scope.spriteTile);
81-
await clickText('delete', scope.spriteTile);
88+
await findByText('delete', scope.contextMenu);
89+
await clickText('delete', scope.contextMenu);
8290

8391
await clickXpath(FILE_MENU_XPATH);
8492
await clickText('Load from your computer');
8593
const input = await findByXpath('//input[@accept=".sb,.sb2,.sb3"]');
8694
await input.sendKeys(path.resolve(__dirname, '../fixtures/project1.sb3'));
8795
await driver.switchTo().alert()
8896
.accept();
89-
await findByText('project1-sprite');
97+
await findByText('project1-sprite', scope.spriteTile);
9098
});
9199

92100
test('Theme picker shows themes', async () => {

0 commit comments

Comments
 (0)