Skip to content

Commit

Permalink
Merge pull request #353 from smalruby/fix-local-test-integration-on-d…
Browse files Browse the repository at this point in the history
…ocker

test: fix for local on macOS
  • Loading branch information
takaokouji authored Aug 17, 2024
2 parents eb40e67 + fd3a178 commit 28a3963
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 1 addition & 2 deletions test/helpers/selenium-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ class SeleniumHelper {
const chromeCapabilities = webdriver.Capabilities.chrome();
const args = [];
if (USE_HEADLESS) {
args.push('--headless');
args.push('--headless=new');
}

if (IS_ROOT_USER) {
args.push('--no-sandbox');
args.push('--disable-setuid-sandbox');
}

args.push('--disable-gpu');
args.push('--disable-dev-shm-usage');
args.push('--disable-extensions');

Expand Down
14 changes: 11 additions & 3 deletions test/integration/menu-bar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ describe('Menu bar settings', () => {

test('Logo should be clickable', async () => {
await loadUri(uri);

// 外部サイトへアクセスするためCIではスキップする
if (process.env.CI) {
await findByXpath('//img[@alt="Smalruby"]');
return;
}

await clickXpath('//img[@alt="Smalruby"]');
const currentUrl = await driver.getCurrentUrl();
await expect(currentUrl).toEqual('https://smalruby.jp/');
Expand All @@ -70,23 +77,24 @@ describe('Menu bar settings', () => {
const input = await findByXpath('//input[@accept=".sb,.sb2,.sb3"]');
await input.sendKeys(path.resolve(__dirname, '../fixtures/project1.sb3'));
// No replace alert since no changes were made
await findByText('project1-sprite');
await findByText('project1-sprite', scope.spriteTile);
});

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

// Change the project by deleting a sprite
await rightClickText('Sprite1', scope.spriteTile);
await clickText('delete', scope.spriteTile);
await findByText('delete', scope.contextMenu);
await clickText('delete', scope.contextMenu);

await clickXpath(FILE_MENU_XPATH);
await clickText('Load from your computer');
const input = await findByXpath('//input[@accept=".sb,.sb2,.sb3"]');
await input.sendKeys(path.resolve(__dirname, '../fixtures/project1.sb3'));
await driver.switchTo().alert()
.accept();
await findByText('project1-sprite');
await findByText('project1-sprite', scope.spriteTile);
});

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

0 comments on commit 28a3963

Please sign in to comment.